From 6b69e2bfad63b76bb850ac26986f114870f29837 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 15 Dec 2016 16:41:33 -0800 Subject: [PATCH] miner: move tx.isFinal. --- lib/mining/miner.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/mining/miner.js b/lib/mining/miner.js index d5557ee0..d2945bed 100644 --- a/lib/mining/miner.js +++ b/lib/mining/miner.js @@ -420,12 +420,6 @@ Miner.prototype.build = function build(attempt) { if (tx.isCoinbase()) throw new Error('Cannot add coinbase to block.'); - if (!tx.isFinal(attempt.height, attempt.locktime)) - continue; - - if (!attempt.witness && tx.hasWitness()) - continue; - for (j = 0; j < tx.inputs.length; j++) { input = tx.inputs[j]; prev = input.prevout.hash; @@ -454,6 +448,9 @@ Miner.prototype.build = function build(attempt) { weight = attempt.weight; sigops = attempt.sigops; + if (!tx.isFinal(attempt.height, attempt.locktime)) + continue; + if (!attempt.witness && tx.hasWitness()) continue;