Use shared input's txOut
in shouldSignFirst
#724
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When deciding who must send
tx_signatures
first for a splice, we compute how much each node contributes to the splice transaction by adding the amount of thetx_add_input
they have sent.For the shared input (current channel output), instead of using the
txOut
amount, we previously summed the balance of each node in the channel. The result is the same when there are no pending HTLCs, but when there are pending HTLCs, it underestimates the amount of this input.This is hard to reproduce (and test) because it requires both nodes to contribute to the splice while having large pending HTLCs that tilt the balance in favor of the wrong side.