-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wallet: RBF batch payments manager #9298
base: master
Are you sure you want to change the base?
Conversation
b71b11f
to
45c7543
Compare
a48e7ca
to
5c7a247
Compare
3bdbf87
to
3ad4406
Compare
This does not correspond to the code in the |
Can confirm it doesn't happen on this branch, only on master. |
1b9218c
to
be6f9bb
Compare
9f589b0
to
ccb0cc3
Compare
Note: This PR does not work well with fee settings. When we change the fee settings in |
ccb0cc3
to
3325ca1
Compare
39e40c0
to
7918670
Compare
2a231a5
to
88a16f1
Compare
The class TxBatcher handles the creation, broadcast and replacement of replaceable transactions. Callers (LNWatcher, SwapManager) use methods add_payment_output and add_sweep_info. Transactions created by TxBatcher may combine sweeps and outgoing payments. Transactions created by TxBatcher will have their fee bumped automatically (this was only the case for sweeps before). TxBatcher manages several TxBatches. TxBatches are created dynamically when needed. The GUI does not touch txbatcher transactions: - wallet.get_candidates_for_batching excludes txbatcher transactions - RBF dialogs do not work with txbatcher transactions wallet: - instead of reading config variables, make_unsigned_transaction takes new parameters: base_tx, send_change_to_lighting tests: - unit tests in test_txbatcher.py (replaces test_sswaps.py) - force all regtests to use MPP, so that we sweep transactions with several HTLCs. This forces the payment manager to aggregate first-stage HTLC tx inputs. second-stage are not batched for now.
88a16f1
to
94f4b0b
Compare
tx = self.create_transaction( | ||
inputs=[txin], | ||
outputs=[], | ||
password=None, | ||
fee_policy=FixedFeePolicy(0), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no outputs and zero fee? what is this supposed to do?
and in any case, maybe we should make make_unsigned_transaction enforce there is at least one output (that's a consensus rule btw)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given no outputs, make_unsigned_transaction
will send all the coins to a change address.
Zero fee: this is a future transaction, its purpose is only to provide feedback to the user.
A fee will be added when the actual tx is broadcast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given no outputs, make_unsigned_transaction will send all the coins to a change address.
Ah right... ok, makes sense. Could you add a comment "this will send all the coins to a change address"?
Note that create_transaction
tries to sign this by default. Is that intentional in this case? (with zero fee?)
(indeed we should just kill wallet.create_transaction
)
note: this is not "reorg safe", meaning that there is no guarantee that all payments will end up in in the blockchain.
However, I believe this is "double send safe", meaning that we will never send a payment twice.