diff --git a/lib/bcoin/miner.js b/lib/bcoin/miner.js index eccde6b6..c4d7f44f 100644 --- a/lib/bcoin/miner.js +++ b/lib/bcoin/miner.js @@ -36,14 +36,19 @@ exports.miner = function miner(options, callback) { } function addTX(tx) { - var s; + if (tx.inputs[0].output && !tx.verify()) + return; + if (tx.height !== -1) return; - s = tx.render().length; - if (block.size() + s > constants.blocks.maxSize) + + if (block.size() + tx.size() > constants.blocks.maxSize) return; + nextBlock.txs.push(tx); + fee.iadd(tx.getFee()); + // Update coinbase value updateCoinbase(nextBlock); // Update merkle root for new coinbase and new tx