test: Set hashFinalSaplingRoot default correctly in create_block

This commit is contained in:
Jack Grigg 2020-11-18 11:12:09 +00:00
parent 030a685392
commit a7f9365fb8
1 changed files with 4 additions and 2 deletions

View File

@ -16,8 +16,10 @@ def create_block(hashprev, coinbase, nTime=None, nBits=None, hashFinalSaplingRoo
else:
block.nTime = nTime
block.hashPrevBlock = hashprev
if hashFinalSaplingRoot is not None:
block.hashFinalSaplingRoot = hashFinalSaplingRoot
if hashFinalSaplingRoot is None:
# By default NUs up to Sapling are active from block 1, so we set this to the empty root.
hashFinalSaplingRoot = 0x3e49b5f954aa9d3545bc6c37744661eea48d7c34e3000d82b7f0010c30f4c2fb
block.hashFinalSaplingRoot = hashFinalSaplingRoot
if nBits is None:
block.nBits = 0x200f0f0f # difficulty retargeting is disabled in REGTEST chainparams
else: