Don't attempt to resume channels if we already exchanged funding #3051
+50
−9
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.
ddf75af introduced the ability to re-exchange our
ChannelOpen
after a peer disconnects if we didn't complete funding on our end. It did not implement nor consider what would happen if we re-connected after we created our own funding transactions, and currently it panics (and even if it did not it would replay theFundingTransactionGenerated
event to users).While we'd very much like to replay the
open_channel
flow even if we have already received anaccept_channel
and funded the channel, we cannot as the peer will likely provide different key material in theiraccept_channel
, causing us to need a different funding transaction.Thus, here, we simply close channels which have been funded but not yet signed when our peer disconnects.
Replaces #2983 (comment)
Note that this is the same as the version we already landed for 0.0.123, but I was hoping we could do more, but sadly @shaavan pointed out we cannot.