Skip to content

Commit fac90c5

Browse files
author
MarcoFalke
committed
test: Create all blocks with version 4 or higher
1 parent 8cb4307 commit fac90c5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

test/functional/test_framework/blocktools.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,15 @@
5959
WITNESS_COMMITMENT_HEADER = b"\xaa\x21\xa9\xed"
6060

6161
NORMAL_GBT_REQUEST_PARAMS = {"rules": ["segwit"]}
62+
VERSIONBITS_LAST_OLD_BLOCK_VERSION = 4
6263

6364

6465
def create_block(hashprev=None, coinbase=None, ntime=None, *, version=None, tmpl=None, txlist=None):
6566
"""Create a block (with regtest difficulty)."""
6667
block = CBlock()
6768
if tmpl is None:
6869
tmpl = {}
69-
block.nVersion = version or tmpl.get('version') or 1
70+
block.nVersion = version or tmpl.get('version') or VERSIONBITS_LAST_OLD_BLOCK_VERSION
7071
block.nTime = ntime or tmpl.get('curtime') or int(time.time() + 600)
7172
block.hashPrevBlock = hashprev or int(tmpl['previousblockhash'], 0x10)
7273
if tmpl and not tmpl.get('bits') is None:

test/functional/test_framework/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ def __init__(self, header=None):
615615
self.calc_sha256()
616616

617617
def set_null(self):
618-
self.nVersion = 1
618+
self.nVersion = 4
619619
self.hashPrevBlock = 0
620620
self.hashMerkleRoot = 0
621621
self.nTime = 0

0 commit comments

Comments
 (0)