note: tests needed changing due to behavioural change in wallet.get_receiving_address()
Previously wallet.get_receiving_address used wallet.db.get_addr_history,
now it (indirectly) uses wallet.get_address_history, which now also considers local txns.
Scenario: select some UTXOs in the 'Coins' tab. Create a tx and sign it.
Close the tx dialog without broadcasting/etc (cancel tx).
Signatures would remain for selected UTXOs.
Create new tx -> invalid sigs.
- no more passing around "invoice" in GUIs, invoice "paid" detection is now handled by wallet logic
- a tx can now pay for multiple invoices
- an invoice can now be paid by multiple txs (through partial payments)
- new data structure in storage: prevouts_by_scripthash
- type: scripthash -> set of (outpoint, value)
- also, storage upgrade to build this for existing wallets
- allow 'spend max' when opening a channel (fixes#5698)
- display amount minus fee when 'max' buttons are pressed
- estimate fee of channel funding using a template with dummy address
When "importing" a psbt, we accept witness utxos even for legacy inputs
(warning shown to user in gui).
When "exporting" a psbt, we follow the spec; except when exporting as a QR code,
in which case we include witness utxos for all inputs.
This makes QR codes for psbts with legacy inputs feasible, just like they
were before, with our custom tx serialization format (with the same risk,
of burning coins as miner fees).
- Move 'handle_error_code_from_failed_htlc' to channel_db,
and call it from pay_to_route, because it should not be
called when HTLCs are forwarded.
- Replace 'payment_received' and 'payment_status'
callbacks with 'invoice_status' and 'request_status'.
- Show payment error logs in the Qt GUI
- In the invoices list, show paid invoices for which
we still have the log.
The few other cases that used SimpleConfig.get_instance() now
either get passed a config instance, or they try to get a reference
to something else that has a reference to a config.
(see lnsweep, qt/qrcodewidget, qt/qrtextedit)
- use InvoiceInfo (NamedTuple) for normal operations,
because lndecode operations can be very slow.
- all invoices/requests are stored in wallet
- invoice expiration detection is performed in wallet
- CLI commands: list_invoices, add_request, add_lightning_request
- revert 0062c6d695 because it forbids self-payments
when pasting a new invoice and paying it
Traceback (most recent call last):
File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 358, in _do_send_onchain
tx = self.app.wallet.make_unsigned_transaction(coins, outputs, None)
File "/home/user/wspace/electrum/electrum/wallet.py", line 849, in make_unsigned_transaction
if o.type == TYPE_ADDRESS:
AttributeError: 'tuple' object has no attribute 'type'
when loading back a saved invoice
Traceback (most recent call last):
File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 358, in _do_send_onchain
tx = self.app.wallet.make_unsigned_transaction(coins, outputs, None)
File "/home/user/wspace/electrum/electrum/wallet.py", line 849, in make_unsigned_transaction
if o.type == TYPE_ADDRESS:
AttributeError: 'list' object has no attribute 'type'
- We need only two types: PR_TYPE_ONCHAIN and PR_TYPE_LN
- BIP70 is no longer a type, but an optional field in the dict
- Invoices in the wallet are indexed by a hash of their serialized list of outputs.
- Requests are still indexed by address, because we never generate Paytomany requests.
- Add 'clear_invoices' command to CLI
- Add 'save invoice' button to Qt