mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 14:37:42 -03:00
Use OP_0 for BIP34 padding in signet and tests
For blocks 1 through 15 the script_BIP34_coinbase_height appends OP_1 to comply with BIP34 and avoid bad-cb-length. This is inconsistent with BlockAssembler::CreateNewBlock() which adds OP_0 instead. The utxo_total_supply fuzzer and MinerTestingSetup::Block also use OP_0. Changing it is required to import the test vectors in the next commit. It also ensures the test vectors can be regenerated using the CPU miner at https://github.com/pooler/cpuminer without patches (it uses OP_0). The same helper is used by the signet miner, so this will impact newly bootstrapped signets.
This commit is contained in:
parent
cf0a62878b
commit
c4f68c12e2
1 changed files with 3 additions and 3 deletions
|
@ -35,7 +35,7 @@ from .script import (
|
|||
CScript,
|
||||
CScriptNum,
|
||||
CScriptOp,
|
||||
OP_1,
|
||||
OP_0,
|
||||
OP_RETURN,
|
||||
OP_TRUE,
|
||||
)
|
||||
|
@ -128,8 +128,8 @@ def add_witness_commitment(block, nonce=0):
|
|||
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])
|
||||
# Append dummy to increase scriptSig size to 2 (see bad-cb-length consensus rule)
|
||||
return CScript([res, OP_0])
|
||||
return CScript([CScriptNum(height)])
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue