tests: Add witness commitment if we have a witness transaction in FullBlockTest.update_block()
This commit is contained in:
1 parent
e221b25246
commit
a7c96f874d
2 files changed
+20
No files matched your search
@@ -7,6 +7,7 @@ import copy
|
||||
import time
|
||||
|
||||
from test_framework.blocktools import (
|
||||
add_witness_commitment,
|
||||
create_block,
|
||||
create_coinbase,
|
||||
create_tx_with_script,
|
||||
@@ -1416,6 +1417,9 @@ class FullBlockTest(BitcoinTestFramework):
|
||||
if nTime is not None:
|
||||
block.nTime = nTime
|
||||
block.hashMerkleRoot = block.calc_merkle_root()
|
||||
has_witness_tx = any(not tx.wit.is_null() for tx in block.vtx)
|
||||
if has_witness_tx:
|
||||
add_witness_commitment(block)
|
||||
block.solve()
|
||||
# Update the internal state just like in next_block
|
||||
self.tip = block
|
||||
|
||||
Reference in new issue
Block a user