When exporting a tx as qr code, the prev txs are omitted to save space.
This causes problems with offline signers: software electrum signers will
just warn and then proceed, but hw devices will typically error.
This allows users to edit labels from the utxo_dialog,
without having to search for the transaction in history.
Also, remove block hash from tx dialog: not very useful, and
available through block explorers. (the situation where this
could be useful is case of a chain fork, but in that case the
tx might be mined in both branches of the fork, and we would
want to know that).
If checked, we download prev (parent) txs from the network, asynchronously.
This allows calculating the fee and showing "input addresses".
We could also SPV-verify the tx, to fill in missing tx_mined_status
(block height, blockhash, timestamp, short ids), but this is not done currently.
Note that there is no clean way to do this with electrum protocol 1.4:
`blockchain.transaction.get_merkle(tx_hash, height)` requires knowledge of the block height.
Loosely based on 6112fe0e51
- wallet.add_input_info() previously had a fallback to download parent
prev txs from the network (after a lookup in wallet.db failed).
wallet.add_input_info() is not async, so the network request cannot
be done cleanly there and was really just a hack.
- tx.add_info_from_wallet() calls wallet.add_input_info() on each txin,
in which case these network requests were done sequentially, not concurrently
- the network part of wallet.add_input_info() is now split out into new method:
txin.add_info_from_network()
- in addition to tx.add_info_from_wallet(), there is now also tx.add_info_from_network()
- callers of old tx.add_info_from_wallet() should now called either
- tx.add_info_from_wallet(), then tx.add_info_from_network(), preferably in that order
- tx.add_info_from_wallet() alone is sufficient if the tx is complete,
or typically when not in a signing context
- callers of wallet.bump_fee and wallet.dscancel are now expected to have already
called tx.add_info_from_network(), as it cannot be done in a non-async context
(but for the common case of all-inputs-are-ismine, bump_fee/dscancel should work regardless)
- PartialTxInput.utxo was moved to the baseclass, TxInput.utxo
That way, users can see the effects settings directly on their transaction.
This changes the API of make_tx:
- get_coins is called inside make_tx, so that inputs can be changed dynamically
- make_tx takes an optional parameter: unconfirmed_only, passed to get_coins
- ConfirmTxDialog detects if we can pay by disabling confirmed_only or lowering fee
Traceback (most recent call last):
File "/home/user/wspace/electrum/electrum/gui/qt/transaction_dialog.py", line 255, in _open_internal_link
self.main_window.do_process_from_txid(txid=target, parent=self)
File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 2212, in do_process_from_txid
self.show_transaction(tx)
File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 1079, in show_transaction
show_transaction(tx, parent=self, desc=tx_desc)
File "/home/user/wspace/electrum/electrum/gui/qt/transaction_dialog.py", line 351, in show_transaction
d = TxDialog(tx, parent=parent, desc=desc, prompt_if_unsaved=prompt_if_unsaved)
File "/home/user/wspace/electrum/electrum/gui/qt/transaction_dialog.py", line 449, in __init__
self.update()
File "/home/user/wspace/electrum/electrum/gui/qt/transaction_dialog.py", line 667, in update
tx_mined_status = self.wallet.lnworker.lnwatcher.adb.get_tx_height(txid)
AttributeError: 'NoneType' object has no attribute 'adb'
```
629.08 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
File ".../electrum/electrum/gui/qt/invoice_list.py", line 170, in <lambda>
menu.addAction(_("Pay") + "...", lambda: self.send_tab.do_pay_invoice(invoice))
File ".../electrum/electrum/gui/qt/send_tab.py", line 573, in do_pay_invoice
self.pay_onchain_dialog(self.window.get_coins(), invoice.outputs)
File ".../electrum/electrum/gui/qt/send_tab.py", line 251, in pay_onchain_dialog
self.window.show_transaction(tx)
File ".../electrum/electrum/gui/qt/main_window.py", line 1074, in show_transaction
show_transaction(tx, parent=self, desc=tx_desc)
File ".../electrum/electrum/gui/qt/transaction_dialog.py", line 351, in show_transaction
d = TxDialog(tx, parent=parent, desc=desc, prompt_if_unsaved=prompt_if_unsaved)
File ".../electrum/electrum/gui/qt/transaction_dialog.py", line 450, in __init__
self.set_title()
File ".../electrum/electrum/gui/qt/transaction_dialog.py", line 858, in set_title
self.setWindowTitle(_("Transaction") + ' ' + self.tx.txid())
TypeError: can only concatenate str (not "NoneType") to str
```
```
Traceback (most recent call last):
File "/home/user/wspace/electrum/electrum/gui/qt/invoice_list.py", line 169, in <lambda>
menu.addAction(_("Pay") + "...", lambda: self.send_tab.do_pay_invoice(invoice))
File "/home/user/wspace/electrum/electrum/gui/qt/send_tab.py", line 585, in do_pay_invoice
self.pay_onchain_dialog(self.window.get_coins(), invoice.outputs)
File "/home/user/wspace/electrum/electrum/gui/qt/send_tab.py", line 271, in pay_onchain_dialog
preview_dlg = PreviewTxDialog(
File "/home/user/wspace/electrum/electrum/gui/qt/transaction_dialog.py", line 962, in __init__
self.update()
File "/home/user/wspace/electrum/electrum/gui/qt/transaction_dialog.py", line 658, in update
self.io_widget.update(self.tx)
File "/home/user/wspace/electrum/electrum/gui/qt/transaction_dialog.py", line 212, in update
tx_height, tx_pos = self.wallet.adb.get_txpos(self.tx.txid())
File "/home/user/wspace/electrum/electrum/address_synchronizer.py", line 483, in get_txpos
verified_tx_mined_info = self.db.get_verified_tx(tx_hash)
File "/home/user/wspace/electrum/electrum/json_db.py", line 44, in wrapper
return func(self, *args, **kwargs)
File "/home/user/wspace/electrum/electrum/wallet_db.py", line 1256, in get_verified_tx
assert isinstance(txid, str)
AssertionError
```
textedit.setMinimumWidth(950) (from 5af399d19639b0c141398db964270c4974f124acdoes) does not play well with the tx_dlg.setMinimumWidth(640)
when resizing. Make 950 only affect the default sizing of the textedit.
- this widget will be used in various dialogs
- making this change now will prevent downstream conflicts
- the part that displays "coin selection active" was commented out
ShortIDs were originally designed for lightning channels, and are now
understood by some block explorers.
This allows to remove one column in the UTXO tab (height is redundant).
In the transaction dialog, the space saving ensures that all inputs fit
into one line (it was not the case previously with p2wsh addresses).
For clarity and consistency, the ShortID is displayed for both inputs
and outputs in the transaction dialog.
preference from the GUI, because the mempoolfullrbf option in
Bitcoin 0.24 makes RBF signaling pretty meaningless. Fixes#8088.
Note: RBF remains disabled for channel funding transactions.
In that case, the flag is actually only used as a semaphore
between different instances of the same wallet.
- separate AddressSynchronizer from Wallet and LNWatcher
- the AddressSynchronizer class is referred to as 'adb' (address database)
- Use callbacks to replace overloaded methods
Sometimes we want its "remember path" behaviour but it does not make sense to
parent the dialog from main window. When so, caller code no longer needs to
get a reference to a main window.
Also rm last usages of get_parent_main_window().