miner: try to verify txs.
This commit is contained in:
parent
20f8c82c7f
commit
61da977a3f
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user