Closed optout21 closed 2 weeks ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 90.88%. Comparing base (
66fb520
) to head (8339270
). Report is 64 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Note: Changing this behavior causes a single test case to fail: ln::payment_tests::test_completed_payment_not_retryable_on_reload
(reproducible by not resetting funding_transaction
in the original code, or keeping funding_transaction_rebroadcast_flag
always false in the version of this PR)
The check that fails expects 1 broadcasted transaction, while with the change it will have the transaction broadcasted 4 times. I suspect this change does not really affect the desired behavior, this checks is simply over-specific and that can be updated, and the change is acceptable.
assert_eq!(nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().split_off(0).len(), 4);
Alternative simpler solution in #3380 -- never clears the funding_transaction
field, no new fields, which may result in additional rebroadcasts.
One should be chosen -- I lean for the simpler solution, but I have no strong opinion.
Supersceded by #3380.
Fixes #3300
In splicing, the funding transaction (not just the ID) is needed during splice negotiation. Funding transaction is kept in field
ChannelContext.funding_transaction
. However, the way it is currently used is that it is cleared when the tx is broadcast, and this fact is used in some logic.This change:
ChannelContext.funding_transaction
when tx is broadcast, but it's preservedfunding_transaction_broadcast
bool field to indicate if it has been broadcastSo behavior of not (re)broadcasting twice is preserve (though I am not sure whether this was intentional and it is needed, one test fails if this is changed (
test_completed_payment_not_retryable_on_reload
)).Alternative would be to leave
funding_transaction
unchanged, and introduce a newfunding_transaction_saved
field, that is set the same way, but never cleared. This way existing logic would not be affected, but the tx would be kept in two copies.