Rework ChannelManager::funding_transaction_signed #4257
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.
Previously, we'd emit a
FundingTransactionReadyForSigningevent once the initialcommitment_signedis exchanged for a splicing/dual-funding attempt and require users to call back with their signed inputs usingChannelManager::funding_transaction_signed. While this approach worked in practice, it prevents us from abandoning a splice if we cannot or no longer wish to sign as the splice has already been committed to by this point.This commit reworks the API such that this is now possible. After exchanging
tx_complete, we will no longer immediately send our initialcommitment_signed. We will now emit theFundingTransactionReadyForSigningevent and wait for the user to call back before releasing both our initialcommitment_signedand ourtx_signatures. As a result, the event is now persisted, as there is only one possible path in which it is generated. Note that we continue to only emit the event if a local contribution to negotiated transaction was made.Future work will expose a cancellation API such that we can abandon splice attempts safely (we can just force close the channel with dual-funding).