From: Matt Corallo Date: Thu, 2 Aug 2018 10:32:11 +0000 (-0400) Subject: Fix fuzztarget insert_combine hash-collision panic X-Git-Tag: v0.0.12~354^2~2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=482648bbf0a1e4ba101184a9381cb8a76fea0791;p=rust-lightning Fix fuzztarget insert_combine hash-collision panic --- diff --git a/src/ln/channelmonitor.rs b/src/ln/channelmonitor.rs index ae8f4f4a6..ffc9ed26f 100644 --- a/src/ln/channelmonitor.rs +++ b/src/ln/channelmonitor.rs @@ -423,7 +423,9 @@ impl ChannelMonitor { pub fn insert_combine(&mut self, mut other: ChannelMonitor) -> Result<(), HandleError> { if self.funding_txo.is_some() { - if other.funding_txo.is_some() && other.funding_txo.as_ref().unwrap() != self.funding_txo.as_ref().unwrap() { + // We should be able to compare the entire funding_txo, but in fuzztarget its trivially + // easy to collide the funding_txo hash and have a different scriptPubKey. + if other.funding_txo.is_some() && other.funding_txo.as_ref().unwrap().0 != self.funding_txo.as_ref().unwrap().0 { return Err(HandleError{err: "Funding transaction outputs are not identical!", action: None}); } } else {