miner: try to verify txs.

This commit is contained in:
Christopher Jeffrey 2016-01-04 05:03:24 -08:00
parent 20f8c82c7f
commit 61da977a3f

View File

@ -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