From a94f8d2deaefd3068ad20291f720a74ea3cb5cf6 Mon Sep 17 00:00:00 2001 From: davidchocholaty Date: Fri, 8 Nov 2024 10:53:13 +0100 Subject: [PATCH] Get back witness calculation --- src/main.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index 3cbd532..3ed909f 100644 --- a/src/main.py +++ b/src/main.py @@ -30,15 +30,14 @@ def parse_arguments(): # TODO pokracovani - transaction_hashes = [calculate_txid(COINBASE_TRANSACTION)] + [calculate_txid(json_transaction) for json_transaction in mempool.valid_transactions] + block_transactions = [COINBASE_TRANSACTION] + mempool.valid_transactions + + transaction_hashes = [calculate_txid(COINBASE_TRANSACTION)] + [calculate_txid(json_transaction) for json_transaction in block_transactions[1:]] block_hash = block_mining(transaction_hashes).hex() - #wtxids = ["0000000000000000000000000000000000000000000000000000000000000000"] + transaction_hashes[1:] - #wtxids = ["0000000000000000000000000000000000000000000000000000000000000000"] + transaction_hashes - wtxids = transaction_hashes - - witness_commitment = calculate_witness_commitment(wtxids) + wtxids = ["0000000000000000000000000000000000000000000000000000000000000000"] + transaction_hashes[1:] + witness_commitment = calculate_witness_commitment(wtxids) scriptpubkey_wc = '6a24aa21a9ed' + witness_commitment COINBASE_TRANSACTION["vout"][1]["scriptpubkey"] = scriptpubkey_wc