X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchannel.rs;h=e539490951d9b2e9cd780c2189c1e76775ae7586;hb=28794931b72d7de3f79a554321fb3892c66f9e80;hp=262342d41d3c633b362f4660e65bd5c8685f3893;hpb=c8b51228d6c7012659aa4b4a37591dc27222937c;p=rust-lightning diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index 262342d4..e5394909 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -1708,6 +1708,7 @@ impl Channel { let mut removed_outbound_total_msat = 0; for ref htlc in self.pending_outbound_htlcs.iter() { if let OutboundHTLCState::AwaitingRemoteRevokeToRemove(None) = htlc.state { +debug_assert!(false, "This should be triggerable, and we should add a test case that does so!"); removed_outbound_total_msat += htlc.amount_msat; } else if let OutboundHTLCState::AwaitingRemovedRemoteRevoke(None) = htlc.state { removed_outbound_total_msat += htlc.amount_msat; @@ -2360,6 +2361,7 @@ impl Channel { } } + #[cfg_attr(all(test, feature = "mutation_testing"), mutate)] /// Removes any uncommitted HTLCs, to be used on peer disconnection, including any pending /// HTLCs that we intended to add but haven't as we were waiting on a remote revoke. /// Returns the set of PendingHTLCStatuses from remote uncommitted HTLCs (which we're @@ -2446,6 +2448,7 @@ impl Channel { self.channel_state |= ChannelState::MonitorUpdateFailed as u32; } + #[cfg_attr(all(test, feature = "mutation_testing"), mutate)] /// Indicates that the latest ChannelMonitor update has been committed by the client /// successfully and we should restore normal operation. Returns messages which should be sent /// to the remote side.