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) {
|
function addTX(tx) {
|
||||||
var s;
|
if (tx.inputs[0].output && !tx.verify())
|
||||||
|
return;
|
||||||
|
|
||||||
if (tx.height !== -1)
|
if (tx.height !== -1)
|
||||||
return;
|
return;
|
||||||
s = tx.render().length;
|
|
||||||
if (block.size() + s > constants.blocks.maxSize)
|
if (block.size() + tx.size() > constants.blocks.maxSize)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nextBlock.txs.push(tx);
|
nextBlock.txs.push(tx);
|
||||||
|
|
||||||
fee.iadd(tx.getFee());
|
fee.iadd(tx.getFee());
|
||||||
|
|
||||||
// Update coinbase value
|
// Update coinbase value
|
||||||
updateCoinbase(nextBlock);
|
updateCoinbase(nextBlock);
|
||||||
// Update merkle root for new coinbase and new tx
|
// Update merkle root for new coinbase and new tx
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user