@@ -3576,11 +3576,11 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
3576
3576
// already does not permit it, it is impossible to trigger in the
3577
3577
// witness tree.
3578
3578
if (block.vtx [0 ].wit .vtxinwit .size () != 1 || block.vtx [0 ].wit .vtxinwit [0 ].scriptWitness .stack .size () != 1 || block.vtx [0 ].wit .vtxinwit [0 ].scriptWitness .stack [0 ].size () != 32 ) {
3579
- return state.DoS (100 , error (" %s : invalid witness nonce size" , __func__), REJECT_INVALID, " bad-witness-nonce-size " , true );
3579
+ return state.DoS (100 , false , REJECT_INVALID, " bad-witness-nonce-size " , true , strprintf (" %s : invalid witness nonce size" , __func__));
3580
3580
}
3581
3581
CHash256 ().Write (hashWitness.begin (), 32 ).Write (&block.vtx [0 ].wit .vtxinwit [0 ].scriptWitness .stack [0 ][0 ], 32 ).Finalize (hashWitness.begin ());
3582
3582
if (memcmp (hashWitness.begin (), &block.vtx [0 ].vout [commitpos].scriptPubKey [6 ], 32 )) {
3583
- return state.DoS (100 , error (" %s : witness merkle commitment mismatch" , __func__), REJECT_INVALID, " bad-witness-merkle-match " , true );
3583
+ return state.DoS (100 , false , REJECT_INVALID, " bad-witness-merkle-match " , true , strprintf (" %s : witness merkle commitment mismatch" , __func__));
3584
3584
}
3585
3585
fHaveWitness = true ;
3586
3586
}
@@ -3590,7 +3590,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
3590
3590
if (!fHaveWitness ) {
3591
3591
for (size_t i = 0 ; i < block.vtx .size (); i++) {
3592
3592
if (!block.vtx [i].wit .IsNull ()) {
3593
- return state.DoS (100 , error (" %s : unexpected witness data found" , __func__), REJECT_INVALID, " unexpected-witness " , true );
3593
+ return state.DoS (100 , false , REJECT_INVALID, " unexpected-witness " , true , strprintf (" %s : unexpected witness data found" , __func__));
3594
3594
}
3595
3595
}
3596
3596
}
@@ -3602,7 +3602,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
3602
3602
// the block hash, so we couldn't mark the block as permanently
3603
3603
// failed).
3604
3604
if (GetBlockWeight (block) > MAX_BLOCK_WEIGHT) {
3605
- return state.DoS (100 , error ( " ContextualCheckBlock(): weight limit failed " ) , REJECT_INVALID, " bad-blk-weight" );
3605
+ return state.DoS (100 , false , REJECT_INVALID, " bad-blk-weight" , false , strprintf ( " %s : weight limit failed " , __func__) );
3606
3606
}
3607
3607
3608
3608
return true ;
0 commit comments