From 926f8150ec0ec80b1afb7bcf7c4e89f3092208ea Mon Sep 17 00:00:00 2001 From: tripathyr Date: Wed, 21 Sep 2022 17:43:40 +0530 Subject: [PATCH] Update lib_btc.js --- lib_btc.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_btc.js b/lib_btc.js index 7c8c588..49a1af9 100644 --- a/lib_btc.js +++ b/lib_btc.js @@ -2615,13 +2615,14 @@ return result.join(''); } - coinjs.getTransactionHash = function (transaction_in_hex) { + coinjs.getTransactionHash = function (transaction_in_hex,changeOutputEndianess) { var x1, x2, x3, x4, x5; x1 = Crypto.util.hexToBytes(transaction_in_hex); x2 = Crypto.SHA256(x1); x3 = Crypto.util.hexToBytes(x2); x4 = Crypto.SHA256(x3); x5 = coinjs.changeEndianness(x4); + if (changeOutputEndianess == true) { x5 = x5 } else if ((typeof changeOutputEndianess == 'undefined') || (changeOutputEndianess == false) ){ x5 = x4 }; return x5; }