File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2012,7 +2012,11 @@ impl Channel {
2012
2012
if self . channel_outbound && msg. scriptpubkey . len ( ) > 34 {
2013
2013
return Err ( HandleError { err : "Got shutdown_scriptpubkey of absurd length from remote peer" , action : None } ) ;
2014
2014
}
2015
- //TODO: Check shutdown_scriptpubkey form as BOLT says we must? WHYYY
2015
+
2016
+ //Check shutdown_scriptpubkey form as BOLT says we must
2017
+ if !( msg. scriptpubkey . is_p2pkh ( ) ) &&!( msg. scriptpubkey . is_p2sh ( ) ) &&!( msg. scriptpubkey . is_v0_p2wpkh ( ) ) &&!( msg. scriptpubkey . is_v0_p2wsh ( ) ) {
2018
+ return Err ( HandleError { err : "Got an invalid scriptpubkey from remote peer" , action : Some ( msgs:: ErrorAction :: DisconnectPeer { msg : None } ) } ) ;
2019
+ }
2016
2020
2017
2021
if self . their_shutdown_scriptpubkey . is_some ( ) {
2018
2022
if Some ( & msg. scriptpubkey ) != self . their_shutdown_scriptpubkey . as_ref ( ) {
You can’t perform that action at this time.
0 commit comments