X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchannelmanager.rs;h=51b3fc1539bcd9edc04f355ece36da40598db5b6;hb=c08aa349f5d1e7c3935b402ee2046b077a294506;hp=a382b38ba6d6648a87246e04e4d0bc54138822ed;hpb=e553a71b6f82c5cc61a0f12084444384058e9bc3;p=rust-lightning diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index a382b38b..51b3fc15 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -9963,11 +9963,14 @@ where } &mut chan.context }, - // We retain UnfundedOutboundV1 channel for some time in case - // peer unexpectedly disconnects, and intends to reconnect again. - ChannelPhase::UnfundedOutboundV1(_) => { - return true; - }, + // If we get disconnected and haven't yet committed to a funding + // transaction, we can replay the `open_channel` on reconnection, so don't + // bother dropping the channel here. However, if we already committed to + // the funding transaction we don't yet support replaying the funding + // handshake (and bailing if the peer rejects it), so we force-close in + // that case. + ChannelPhase::UnfundedOutboundV1(chan) if chan.is_resumable() => return true, + ChannelPhase::UnfundedOutboundV1(chan) => &mut chan.context, // Unfunded inbound channels will always be removed. ChannelPhase::UnfundedInboundV1(chan) => { &mut chan.context