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
f - Check KeysInterface::get_shutdown_scriptpubkey
Check that the user-provided shutdown_scriptpubkey is compatible with
the counterparty's features (option_shutdown_anysegwit).
TODO: Implement for ChannelManager::close_channel
TODO: Add unit tests
if !shutdown_scriptpubkey.is_compatible(&their_features){
604
+
returnErr(APIError::APIMisuseError{err:format!("Provided a scriptpubkey format not accepted by peer. script: ({})", shutdown_scriptpubkey.clone().into_inner().to_bytes().to_hex())});
if !shutdown_scriptpubkey.is_compatible(&their_features){
856
+
returnErr(ChannelError::Close(format!("Provided a scriptpubkey format not accepted by peer. script: ({})", shutdown_scriptpubkey.clone().into_inner().to_bytes().to_hex())));
// If we have any LocalAnnounced updates we'll probably just get back a update_fail_htlc
3274
+
// immediately after the commitment dance, but we can send a Shutdown cause we won't send
3275
+
// any further commitment updates after we set LocalShutdownSent.
3276
+
let send_shutdown = (self.channel_state&ChannelState::LocalShutdownSentasu32) != ChannelState::LocalShutdownSentasu32;
3277
+
3278
+
let shutdown_scriptpubkey = matchself.shutdown_scriptpubkey{
3279
+
Some(_) => None,
3280
+
None => {
3281
+
assert!(send_shutdown);
3282
+
let shutdown_scriptpubkey = keys_provider.get_shutdown_scriptpubkey();
3283
+
if !shutdown_scriptpubkey.is_compatible(their_features){
3284
+
returnErr(ChannelError::Close(format!("Provided a scriptpubkey format not accepted by peer. script: ({})", shutdown_scriptpubkey.clone().into_inner().to_bytes().to_hex())));
0 commit comments