You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: ({})", script.to_bytes().to_hex())));
699
699
}
700
700
701
-
// Peer is signaling upfront_shutdown and has provided a non-accepted scriptpubkey format. We enforce it while receiving shutdown msg
702
-
if script.is_p2pkh() || script.is_p2sh() || script.is_v0_p2wsh() || script.is_v0_p2wpkh(){
703
-
Some(script.clone())
704
-
// Peer is signaling upfront_shutdown and has opt-out with a 0-length script. We don't enforce anything
705
-
}elseif script.len() == 0{
701
+
if script.len() == 0{
706
702
None
707
-
// Peer is signaling upfront_shutdown and has provided a non-accepted scriptpubkey format. Fail the channel
708
703
}else{
709
-
returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: ({})", script.to_bytes().to_hex())));
704
+
Some(script.clone())
710
705
}
711
706
},
712
707
// Peer is signaling upfront shutdown but don't opt-out with correct mechanism (a.k.a 0-length script). Peer looks buggy, we fail the channel
returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: ({})", script.to_bytes().to_hex())));
1400
1395
}
1401
1396
1402
-
// Peer is signaling upfront_shutdown and has provided a non-accepted scriptpubkey format. We enforce it while receiving shutdown msg
1403
-
if script.is_p2pkh() || script.is_p2sh() || script.is_v0_p2wsh() || script.is_v0_p2wpkh(){
1404
-
Some(script.clone())
1405
-
// Peer is signaling upfront_shutdown and has opt-out with a 0-length script. We don't enforce anything
1406
-
}elseif script.len() == 0{
1397
+
if script.len() == 0{
1407
1398
None
1408
-
// Peer is signaling upfront_shutdown and has provided a non-accepted scriptpubkey format. Fail the channel
1409
1399
}else{
1410
-
returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. scriptpubkey: ({})",script.to_bytes().to_hex())));
1400
+
Some(script.clone())
1411
1401
}
1412
1402
},
1413
1403
// Peer is signaling upfront shutdown but don't opt-out with correct mechanism (a.k.a 0-length script). Peer looks buggy, we fail the channel
assert_eq!(msg.data,"Peer is signaling upfront_shutdown but not support for any segwit, and the script is a witness program".to_owned())
7342
+
assert!(regex::Regex::new(r"Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: (\([A-Fa-f0-9]+\))").unwrap().is_match(&*msg.data));
0 commit comments