From 92b446f6a50ba8e463c0977950d0a351b574cb3c Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Fri, 11 Dec 2015 12:39:09 +1100 Subject: [PATCH] block: variable extraction --- src/block.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/block.js b/src/block.js index e6d2365..e34421c 100644 --- a/src/block.js +++ b/src/block.js @@ -134,8 +134,9 @@ Block.calculateTarget = function (bits) { Block.prototype.verifyPow = function () { var hash = [].reverse.call(this.getHash()) + var target = Block.calculateTarget(this.bits) - return compare(hash, Block.calculateTarget(this.bits)) <= 0 + return compare(hash, target) <= 0 } module.exports = Block