Exchange dual funding sigs and wait for channel confirmation#2261
Closed
t-bast wants to merge 9 commits into
Closed
Exchange dual funding sigs and wait for channel confirmation#2261t-bast wants to merge 9 commits into
t-bast wants to merge 9 commits into
Conversation
This is easier to use than having to decide which params we should look into (local or remote). It will also be easier to integrate with dual funding.
This name was very confusing. This feerate only applies to the commit tx, so we make that explicit.
We use a codec trick to make the channelReserve field in LocalParams and RemoteParams an Option[Satoshi].
* Use u16 instead of varint for lengths * Revert channel flags extension * Remove support for non-native segwit inputs
We implement the first step of the dual funding protocol: exchanging `open_channel2` and `accept_channel2`. We currently stop after exchanging these two messages. Future commits will add the interactive-tx protocol used to build the funding transaction.
We build the funding transaction based on the interactive-tx protocol. We currently stop before exchanging signatures. Future commits will add the signature exchange and complete the dual funding flow.
We exchange commit and funding signatures for a dual-funded channel. Once we've signed the funding transaction, we must start to remember this channel as our peer may publish it.
Codecov Report
@@ Coverage Diff @@
## master #2261 +/- ##
==========================================
+ Coverage 84.30% 84.52% +0.22%
==========================================
Files 194 199 +5
Lines 14383 15022 +639
Branches 589 612 +23
==========================================
+ Hits 12125 12698 +573
- Misses 2258 2324 +66
|
We wait for the funding tx to confirm and handle various error cases. We avoid force-closing while we don't know which funding tx will confirm. Instead we just wait for either one of the funding txs to confirm or all funding attempts to be double-spent, which we check regularly.
c744de6 to
728344a
Compare
Member
Author
|
Closing in favor of a better alternative (coming soon). |
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.
We exchange signatures for the funding tx and commit tx, and wait for the funding tx to confirm.
Note that there is one main deviation from the single-funder case: while we're waiting for a funding tx to confirm, we never force-close, because we still don't know which version of the funding tx will confirm and our closing code doesn't handle multiple local commitments (yet). It's ok, we can just wait for one of the funding txs to confirm or double-spend them all (currently outside of eclair, in the future we could add an RPC for that if necessary) to unblock the channel.
NB: this builds on top of #2255