File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2113,7 +2113,16 @@ impl Channel {
2113
2113
if tx. txid ( ) == self . channel_monitor . get_funding_txo ( ) . unwrap ( ) . txid {
2114
2114
let txo_idx = self . channel_monitor . get_funding_txo ( ) . unwrap ( ) . index as usize ;
2115
2115
if txo_idx >= tx. output . len ( ) || tx. output [ txo_idx] . script_pubkey != self . get_funding_redeemscript ( ) . to_v0_p2wsh ( ) ||
2116
- tx. output [ txo_idx] . value != self . channel_value_satoshis {
2116
+ tx. output [ txo_idx] . value != self . channel_value_satoshis {
2117
+ if self . channel_outbound {
2118
+ // If we generated the funding transaction and it doesn't match what it
2119
+ // should, the client is really broken and we should just panic and
2120
+ // tell them off. That said, because hash collisions happen with high
2121
+ // probability in fuzztarget mode, if we're fuzzing we just close the
2122
+ // channel and move on.
2123
+ #[ cfg( not( feature = "fuzztarget" ) ) ]
2124
+ panic ! ( "Client called ChannelManager::funding_transaction_generated with bogus transaction!" ) ;
2125
+ }
2117
2126
self . channel_state = ChannelState :: ShutdownComplete as u32 ;
2118
2127
self . channel_update_count += 1 ;
2119
2128
return Err ( HandleError { err : "funding tx had wrong script/value" , action : Some ( ErrorAction :: DisconnectPeer { msg : None } ) } ) ;
You can’t perform that action at this time.
0 commit comments