Skip to content

Commit

Permalink
fix: use normal byte order for merkle root
Browse files Browse the repository at this point in the history
  • Loading branch information
Nesopie committed Mar 25, 2024
1 parent 375bd55 commit 4726b09
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/features/block/mine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ export const mine = (

const prevBlockHash =
"0000ffff00000000000000000000000000000000000000000000000000000000"; //make it the same as the difficulty
const merkleRootHash = reversify(
merkleRoot(
txs.map((tx) => reversify(sha256(sha256(txSerializer(tx).serializedTx))))
)
const merkleRootHash = merkleRoot(
txs.map((tx) => reversify(sha256(sha256(txSerializer(tx).serializedTx))))
);

const time = Buffer.alloc(4);
Expand Down

0 comments on commit 4726b09

Please sign in to comment.