File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -260,9 +260,13 @@ impl NegotiationContext {
260260 // with witness versions V1 and up are always considered standard. Yes, the scripts can be
261261 // anyone-can-spend-able, but if our counterparty wants to add an output like that then it's none
262262 // of our concern really ¯\_(ツ)_/¯
263- if !msg. script . is_v0_p2wpkh ( )
264- && !msg. script . is_v0_p2wsh ( )
265- && msg. script . witness_version ( ) . map ( |v| v. to_num ( ) < 1 ) . unwrap_or ( true )
263+ //
264+ // TODO: The last check would be simplified when https://github.com/rust-bitcoin/rust-bitcoin/commit/1656e1a09a1959230e20af90d20789a4a8f0a31b
265+ // hits the next release of rust-bitcoin.
266+ if !( msg. script . is_v0_p2wpkh ( )
267+ || msg. script . is_v0_p2wsh ( )
268+ || ( msg. script . is_witness_program ( )
269+ && msg. script . witness_version ( ) . map ( |v| v. to_num ( ) >= 1 ) . unwrap_or ( false ) ) )
266270 {
267271 return Err ( AbortReason :: InvalidOutputScript ) ;
268272 }
You can’t perform that action at this time.
0 commit comments