Post
Topic
Board Development & Technical Discussion
Re: Testnet4 - BIP Rule Ignore
by
garlonicon
on 05/12/2024, 12:57:08 UTC
Quote
Is there a unit test in the codebase for BIP34 block checks, or validating new blocks in general?
https://github.com/bitcoin/bitcoin/blob/master/test/functional/test_framework/blocktools.py#L118
Code:
def script_BIP34_coinbase_height(height):
    if height <= 16:
        res = CScriptOp.encode_op_n(height)
        # Append dummy to increase scriptSig size above 2 (see bad-cb-length consensus rule)
        return CScript([res, OP_1])
    return CScript([CScriptNum(height)])