received and tx.verify.
This commit is contained in:
parent
6b54897b57
commit
8d0f432c7a
@ -444,7 +444,7 @@ TXPool.prototype.getReceived = function getReceived(address) {
|
||||
return this._addresses[address].received.clone();
|
||||
return new bn(0);
|
||||
}
|
||||
return this._sent.clone();
|
||||
return this._received.clone();
|
||||
};
|
||||
|
||||
TXPool.prototype.getBalance = function getBalance(address) {
|
||||
|
||||
@ -411,6 +411,11 @@ TX.prototype.verify = function verify(index, force, flags) {
|
||||
if (this.isCoinbase())
|
||||
return true;
|
||||
|
||||
if (this.getOutputValue().cmp(this.getInputValue()) > 0) {
|
||||
utils.debug('TX is spending funds it does not have.');
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.inputs.every(function(input, i) {
|
||||
if (index != null && i !== index)
|
||||
return true;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user