Get the hex version of the blocks merkle root

This commit is contained in:
Sky Young 2019-07-23 12:23:15 -06:00
parent db1152fed9
commit 9c0b36b965

View File

@ -153,9 +153,8 @@ BlockController.prototype.transformBlock = function(block, info) {
}); });
// MerkleRoot is backwards hex data in the block object, flip before returning // MerkleRoot is backwards hex data in the block object, flip before returning
var merkleRoot = block.merkleRoot; var merkleRoot = block.getMerkleRoot('hex');
if (merkleRoot) {
var strArray = merkleRoot.match(/.{1,2}/g); var strArray = merkleRoot.match(/.{1,2}/g);
var reversedArray = strArray.reverse(); var reversedArray = strArray.reverse();
var builtStr = ""; var builtStr = "";
@ -164,7 +163,6 @@ BlockController.prototype.transformBlock = function(block, info) {
} }
merkleRoot = builtStr merkleRoot = builtStr
}
return { return {
hash: block.rhash(), hash: block.rhash(),