From 22a5aea9f662f5ba3b86f47cbc3b8848112a19ee Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Fri, 10 Jan 2014 14:12:23 -0300 Subject: [PATCH] make transactions calculate their hash on parse --- Transaction.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Transaction.js b/Transaction.js index 0cc95bbd9..e5ca68357 100644 --- a/Transaction.js +++ b/Transaction.js @@ -165,7 +165,8 @@ function spec(b) { }; Transaction.prototype.calcHash = function calcHash() { - return util.twoSha256(this.getBuffer()); + this.hash = util.twoSha256(this.getBuffer()); + return this.hash; }; Transaction.prototype.checkHash = function checkHash() { @@ -623,6 +624,7 @@ function spec(b) { } this.lock_time = parser.word32le(); + this.calcHash(); }; var TransactionInputsCache = exports.TransactionInputsCache =