From e4d961cd99e132e4021184e4931e3d388fb8f7bd Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 8 Dec 2020 22:42:15 +0000 Subject: [PATCH] Fixed merkle root hash calc --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index e9c1c16..bb1660d 100644 --- a/index.js +++ b/index.js @@ -62,6 +62,7 @@ const diff1 = 0x00000000ff000000000000000000000000000000000000000000000000000000 module.exports.RavenBlockTemplate = function(rpcData, poolAddress) { const poolAddrHash = bitcoin.address.fromBase58Check(poolAddress).hash; + let txCoinbase = new bitcoin.Transaction(); let bytesHeight; { // input for coinbase tx @@ -156,7 +157,7 @@ function update_merkle_root_hash(blob_in, blob_out) { transactions.push(tx); offset += tx.byteLength(); } - getMerkleRoot2(transactions).copy(blob_out, 4 + 32); + reverseBuffer(getMerkleRoot2(transactions)).copy(blob_out, 4 + 32); }; module.exports.convertRavenBlob = function(blobBuffer) {