Skip to content

Commit

Permalink
Get back witness calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchocholaty committed Nov 8, 2024
1 parent 8e1b4e0 commit a94f8d2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a94f8d2

Please sign in to comment.