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
Add support for opt_shutdown_anysegwit feature #780
* Implemented protocol.
* Made feature optional.
* Verify that the default value is true.
* Verify that on shutdown,
if Channel.supports_shutdown_anysegwit is enabled,
the script can be a witness program.
* Added a test that verifies that a scriptpubkey
for an unreleased segwit version is handled successfully.
* Added a test that verifies that
if node has op_shutdown_anysegwit disabled,
a scriptpubkey with an unreleased segwit version on shutdown
throws an error.
* Added peer InitFeatures to handle_shutdown
* Check if shutdown script is valid when given upfront.
* Added a test to verify that an invalid test results in error.
* Added a test to check that if a segwit script with version 0 is provided,
the updated anysegwit check detects it and returns unsupported.
returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: ({})",script.to_bytes().to_hex())));
742
+
}
743
+
744
+
if script.len() == 0{
745
745
None
746
-
// Peer is signaling upfront_shutdown and has provided a non-accepted scriptpubkey format. Fail the channel
747
746
}else{
748
-
returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: ({})", script.to_bytes().to_hex())));
747
+
Some(script.clone())
749
748
}
750
749
},
751
750
// 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())));
1443
+
}
1444
+
1445
+
if script.len() == 0{
1447
1446
None
1448
-
// Peer is signaling upfront_shutdown and has provided a non-accepted scriptpubkey format. Fail the channel
1449
1447
}else{
1450
-
returnErr(ChannelError::Close(format!("Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. scriptpubkey: ({})",script.to_bytes().to_hex())));
1448
+
Some(script.clone())
1451
1449
}
1452
1450
},
1453
1451
// 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
0 commit comments