aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-07-03 16:14:55 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-06-18 17:53:53 +0200
commitfac90c55be478f0323eafa1d560ea2c56f04fb23 (patch)
tree50c5ae560f4672f2e094a4e00a690e002655682c /test
parent8cb43077b3705ca7b34f9e7d981d19d600213e98 (diff)
downloadbitcoin-fac90c55be478f0323eafa1d560ea2c56f04fb23.tar.xz
test: Create all blocks with version 4 or higher
Diffstat (limited to 'test')
-rw-r--r--test/functional/test_framework/blocktools.py3
-rwxr-xr-xtest/functional/test_framework/messages.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/test/functional/test_framework/blocktools.py b/test/functional/test_framework/blocktools.py
index f35ea6c122..fe441a093e 100644
--- a/test/functional/test_framework/blocktools.py
+++ b/test/functional/test_framework/blocktools.py
@@ -59,6 +59,7 @@ COINBASE_MATURITY = 100
WITNESS_COMMITMENT_HEADER = b"\xaa\x21\xa9\xed"
NORMAL_GBT_REQUEST_PARAMS = {"rules": ["segwit"]}
+VERSIONBITS_LAST_OLD_BLOCK_VERSION = 4
def create_block(hashprev=None, coinbase=None, ntime=None, *, version=None, tmpl=None, txlist=None):
@@ -66,7 +67,7 @@ def create_block(hashprev=None, coinbase=None, ntime=None, *, version=None, tmpl
block = CBlock()
if tmpl is None:
tmpl = {}
- block.nVersion = version or tmpl.get('version') or 1
+ block.nVersion = version or tmpl.get('version') or VERSIONBITS_LAST_OLD_BLOCK_VERSION
block.nTime = ntime or tmpl.get('curtime') or int(time.time() + 600)
block.hashPrevBlock = hashprev or int(tmpl['previousblockhash'], 0x10)
if tmpl and not tmpl.get('bits') is None:
diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py
index 5a9736a7a3..f3be9c4e5f 100755
--- a/test/functional/test_framework/messages.py
+++ b/test/functional/test_framework/messages.py
@@ -615,7 +615,7 @@ class CBlockHeader:
self.calc_sha256()
def set_null(self):
- self.nVersion = 1
+ self.nVersion = 4
self.hashPrevBlock = 0
self.hashMerkleRoot = 0
self.nTime = 0