From 482648bbf0a1e4ba101184a9381cb8a76fea0791 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 2 Aug 2018 06:32:11 -0400 Subject: [PATCH] Fix fuzztarget insert_combine hash-collision panic --- src/ln/channelmonitor.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 { -- 2.39.5