mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-03 17:30:25 +01:00
test: MiniWallet: always rehash after signing (P2PK mode)
Also explicitly rehash in the cases where we modify a tx after signing in feature_csv_activation.py. Parts of this test relied on the fact that rehashing of transactions is done in the course of calculating a block's merkle root (`calc_merkle_root`), which only works if no hash was calculated before due to a caching mechanism. In the following commit the txid in MiniWallet is calculated via `rehash()`, i.e. this doesn't work anymore and we always have to explicitely have the right hash before we calculate the merkle root.
This commit is contained in:
@@ -127,6 +127,7 @@ class MiniWallet:
|
||||
if not fixed_length:
|
||||
break
|
||||
tx.vin[0].scriptSig = CScript([der_sig + bytes(bytearray([SIGHASH_ALL]))])
|
||||
tx.rehash()
|
||||
|
||||
def generate(self, num_blocks, **kwargs):
|
||||
"""Generate blocks with coinbase outputs to the internal address, and append the outputs to the internal list"""
|
||||
|
||||
Reference in New Issue
Block a user