Unlock utxos during dual funding failures#2390
Merged
Merged
Conversation
When an alternative funding transaction confirms, we need to unlock other candidates: we may not have published them yet if for example we didn't receive remote signatures.
t-bast
commented
Aug 19, 2022
| } | ||
| final case class DATA_CLOSING(commitments: Commitments, | ||
| fundingTx: Option[Transaction], // this will be non-empty if we are the initiator and we got in closing while waiting for our own tx to be published | ||
| fundingTx: Option[UnconfirmedFundingTx], |
Member
Author
There was a problem hiding this comment.
The new trait is a bit verbose, but it highlights the fact that this is only used when the funding tx is unconfirmed (which wasn't obvious before). Alternatively, we could just use an Option[Either[Transaction, SignedSharedTransaction]], let me know what you prefer.
What is still a bit confusing is that in the single-funded case, this can be None for two very different reasons:
- The funding tx is confirmed
- The funding tx is unconfirmed but we're fundee so we don't have it
The dual-funded case doesn't have this ambiguity. I don't know if it's worth fixing for the single-funded case, it would mean wrapping another Option in the SingleFundedUnconfirmedFundingTx case class.
Codecov Report
@@ Coverage Diff @@
## master #2390 +/- ##
==========================================
- Coverage 84.73% 84.68% -0.06%
==========================================
Files 199 199
Lines 15458 15472 +14
Branches 642 640 -2
==========================================
+ Hits 13098 13102 +4
- Misses 2360 2370 +10
|
pm47
reviewed
Aug 19, 2022
pm47
approved these changes
Aug 19, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 an alternative funding transaction confirms, we need to unlock other candidates: we may not have published them yet if for example we didn't receive remote signatures.
This is a breaking change in codecs since #2274, but shouldn't impact anyone if we merge this before people start using dual funding.