You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. If we had an acceptchannel earlier, we check if it matches the one
received just now. If not we error, because the channel parameters
have changed and that warrants renegotiating parameters again.
2. If they do match we simply skip the rest of the function because we
had updated those values already.
return Err(ChannelError::Close("Got an accept_channel message from an inbound peer".to_owned()));
7527
7527
}
7528
-
if !matches!(self.context.channel_state, ChannelState::NegotiatingFunding(flags) if flags == NegotiatingFundingFlags::OUR_INIT_SENT) {
7528
+
if !matches!(self.context.channel_state, ChannelState::NegotiatingFunding(flags) if flags == NegotiatingFundingFlags::OUR_INIT_SENT) && !self.deja_vu() {
7529
7529
return Err(ChannelError::Close("Got an accept_channel message at a strange time".to_owned()));
7530
7530
}
7531
+
if self.outbound_context.received_accept_channel() {
7532
+
if self.outbound_context.received_accept_channel_msg.as_ref().unwrap() == msg {
7533
+
return Ok(());
7534
+
} else {
7535
+
return Err(ChannelError::Close("The new accep_channel_msg doesn't match the old one. Should renegotiating channel parameters".to_owned()));
7536
+
}
7537
+
}
7531
7538
if msg.common_fields.dust_limit_satoshis > 21000000 * 100000000 {
7532
7539
return Err(ChannelError::Close(format!("Peer never wants payout outputs? dust_limit_satoshis was {}", msg.common_fields.dust_limit_satoshis)));
0 commit comments