File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -600,6 +600,10 @@ bool block::is_invalid_witness_commitment() const NOEXCEPT
600600 if (coinbase->inputs_ptr ()->empty ())
601601 return false ;
602602
603+ // If no block tx has witness data the commitment is optional (bip141).
604+ if (!is_segregated ())
605+ return false ;
606+
603607 // If there is a valid commitment, return false (valid).
604608 // Coinbase input witness must be 32 byte witness reserved value (bip141).
605609 // Last output of commitment pattern holds the committed value (bip141).
@@ -610,10 +614,8 @@ bool block::is_invalid_witness_commitment() const NOEXCEPT
610614 if (committed == sha256::double_hash (
611615 generate_merkle_root (true ), reserved))
612616 return false ;
613-
614- // If no valid commitment, return true (invalid) if segregated.
615- // If no block tx has witness data the commitment is optional (bip141).
616- return is_segregated ();
617+
618+ return true ;
617619}
618620
619621// *****************************************************************************
You can’t perform that action at this time.
0 commit comments