X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=rust-lightning;a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Fchannelmonitor.rs;fp=lightning%2Fsrc%2Fchain%2Fchannelmonitor.rs;h=6e2ac3fcf512ed3364fd19af3912bbf350de2c68;hp=e3485e7a7bf40f42ffd7adf9058f4726df3dca4e;hb=09e167019589dcfc5ee9675ad243b337659eafc7;hpb=57feb2630779410b5977ccb3c12dd482a20440fc diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs index e3485e7a..6e2ac3fc 100644 --- a/lightning/src/chain/channelmonitor.rs +++ b/lightning/src/chain/channelmonitor.rs @@ -2451,7 +2451,8 @@ impl ChannelMonitorImpl { output: outp.clone(), }); break; - } else if let Some(ref broadcasted_holder_revokable_script) = self.broadcasted_holder_revokable_script { + } + if let Some(ref broadcasted_holder_revokable_script) = self.broadcasted_holder_revokable_script { if broadcasted_holder_revokable_script.0 == outp.script_pubkey { spendable_output = Some(SpendableOutputDescriptor::DelayedPaymentOutput(DelayedPaymentOutputDescriptor { outpoint: OutPoint { txid: tx.txid(), index: i as u16 }, @@ -2464,7 +2465,8 @@ impl ChannelMonitorImpl { })); break; } - } else if self.counterparty_payment_script == outp.script_pubkey { + } + if self.counterparty_payment_script == outp.script_pubkey { spendable_output = Some(SpendableOutputDescriptor::StaticPaymentOutput(StaticPaymentOutputDescriptor { outpoint: OutPoint { txid: tx.txid(), index: i as u16 }, output: outp.clone(), @@ -2472,11 +2474,13 @@ impl ChannelMonitorImpl { channel_value_satoshis: self.channel_value_satoshis, })); break; - } else if outp.script_pubkey == self.shutdown_script { + } + if outp.script_pubkey == self.shutdown_script { spendable_output = Some(SpendableOutputDescriptor::StaticOutput { outpoint: OutPoint { txid: tx.txid(), index: i as u16 }, output: outp.clone(), }); + break; } } if let Some(spendable_output) = spendable_output {