bump_fee was returning an invalid tx if its input was a
PartialTransaction that had signatures. It was relying on
line 1441 to remove signatures.
Relatedly, the WalletDB used to store such PartialTransactions as
PartialTransaction objects, but only until the program was restarted.
This is because serialising and de-serialising such a tx results in a
Transaction object.
So, combining these two, to reproduce a bug:
- create a tx, sign it, save as local
- bump fee, sign it, save as local
- bump fee --> tx already signed!? --> has old sigs, so it is invalid
Scenario (prior to change):
User opens wallet1 with 10k addresses, and then immediately opens wallet2
with 100 addresses.
wallet1 will synchronise first, fully, and only then will wallet2 start syncing.
Now, wallet1 and wallet2 will sync concurrently (and wallet2 will finish much
sooner as expected).
Previously, if bump_fee decided to add new inputs to the tx, they would
have a different sequence number than the existing inputs. This was
unintentional.
- raise OnionRoutingFailure whenever we want to fail a htlc
- catch that exception in htlc_switch
- this will avoid code duplication in the case of trampoline
Scenario (prior this change):
A task in lnpeer.Peer.taskgroup raises ORIG_EXC, e.g. in htlc_switch.
The taskgroup then cancels all its tasks and then awaits each (in cancel_remaining):
4e64c56042/aiorpcx/curio.py (L217-L221)
In Peer.main_loop, we would want ORIG_EXC to be raised,
but instead LightningPeerConnectionClosed() will be raised as
the Peer._message_loop() task is cancelled, and it is awaited first in cancel_remaining.
We should make sure that if a task is cancelled it will let the CancelledError
propagate out, or at least it does not raise a different exception instead.
- LNWorker is notified about htlc events and creates payment events.
- LNWorker._pay is a while loop that calls create_routes_from_invoice.
- create_route_from_invoices should decide whether to split the payment,
using graph knowledge and feedback from previous attempts (not in this commit)
- data structures for payment logs are simplified into a single type, HtlcLog
* Add functions to determine the script type from a psbt.
* add a function inside PartialTransaction
* P2wsh uses the witness-script field to save the script.
* Limit the detection of script-types that are not multisig.
Previously if the user disabled FX rates in the settings, the UI
would keep showing the fiat amounts everywhere until the next time
the program was started. (and the rates would not even refresh anymore)