Skip to content

Commit

Permalink
fix: Coinbase witnessScript typo
Browse files Browse the repository at this point in the history
  • Loading branch information
humblenginr committed Apr 10, 2024
1 parent 20ac2f6 commit d252424
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mining/coinbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ func AddWitnessCommitment(coinbase *txn.Transaction, txns []*txn.Transaction) er
var witnessPreimage [64]byte
copy(witnessPreimage[:32], witnessMerkleRoot[:])
copy(witnessPreimage[32:], witnessNonce[:])
witnessCommitment := utils.DoubleHash(witnessPreimage[:])
witnessCommitment := utils.DoubleHashRaw(witnessPreimage[:])
witnessScript := []byte{
// OP_RETURN
0x6a,
// OP_DATA36
0x36,
0x24,
0xaa,
0x21,
0xa9,
0xed,
}
witnessScript = append(witnessScript, witnessCommitment...)
witnessScript = append(witnessScript, witnessCommitment[:]...)
witnessOut := txn.Vout{}
witnessOut.Value = 0
witnessOut.ScriptPubKey = hex.EncodeToString(witnessScript)
Expand Down

0 comments on commit d252424

Please sign in to comment.