add chain._checkReward.
This commit is contained in:
parent
badf7e4d83
commit
c559f97c26
@ -691,6 +691,21 @@ Chain.prototype._checkInputs = function _checkInputs(block, prev, flags, callbac
|
||||
});
|
||||
};
|
||||
|
||||
Chain.prototype._checkReward = function _checkReward(block) {
|
||||
var claimed, actual;
|
||||
|
||||
claimed = block.txs[0].getOutputValue();
|
||||
actual = bcoin.block.reward(block.height);
|
||||
|
||||
for (i = 1; i < block.txs.length; i++)
|
||||
actual.iadd(block.txs[i].getFee());
|
||||
|
||||
if (claimed.cmp(actual) > 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
Chain.prototype._fillBlock = function _fillBlock(block, callback) {
|
||||
var self = this;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user