Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
humblenginr committed Apr 11, 2024
1 parent 19b0a68 commit 8c507bf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/mining/coinbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ func AddWitnessCommitmentX(coinbaseTx *txn.Transaction,
// Next, obtain the merkle root of a tree which consists of the
// wtxid of all transactions in the block. The coinbase
// transaction will have a special wtxid of all zeroes.
witnessMerkleRoot := CalcMerkleRoot(blockTxns, true)
wtxids := make([][32]byte, 0)
for _, t := range blockTxns {
wtxids = append(wtxids, [32]byte(utils.ReverseBytes(t.WitnessHash())))
}

witnessMerkleRoot := GenerateMerkleTreeRoot(wtxids)

// The preimage to the witness commitment is:
// witnessRoot || coinbaseWitness
Expand Down

0 comments on commit 8c507bf

Please sign in to comment.