mempool.
This commit is contained in:
parent
5912d65fa8
commit
430e917b79
@ -296,6 +296,11 @@ Mempool.prototype.addTX = function addTX(tx, peer, callback, force) {
|
|||||||
callback = utils.wrap(callback, unlock);
|
callback = utils.wrap(callback, unlock);
|
||||||
callback = utils.asyncify(callback);
|
callback = utils.asyncify(callback);
|
||||||
|
|
||||||
|
if (!this.chain.segwitActive) {
|
||||||
|
if (tx.hasWitness())
|
||||||
|
return callback(new VerifyError('nonstandard', 'no-witness-yet', 0));
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.checkTX(tx, peer))
|
if (!this.checkTX(tx, peer))
|
||||||
return callback(new VerifyError('invalid', 'CheckTransaction failed', -1));
|
return callback(new VerifyError('invalid', 'CheckTransaction failed', -1));
|
||||||
|
|
||||||
@ -421,9 +426,6 @@ Mempool.prototype.verify = function verify(tx, callback) {
|
|||||||
if (this.chain.segwitActive) {
|
if (this.chain.segwitActive) {
|
||||||
flags |= constants.flags.VERIFY_WITNESS;
|
flags |= constants.flags.VERIFY_WITNESS;
|
||||||
mandatory |= constants.flags.VERIFY_WITNESS;
|
mandatory |= constants.flags.VERIFY_WITNESS;
|
||||||
} else {
|
|
||||||
if (tx.hasWitness())
|
|
||||||
return callback(new VerifyError('nonstandard', 'no-witness-yet', 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.requireStandard && !tx.isStandardInputs(flags)) {
|
if (this.requireStandard && !tx.isStandardInputs(flags)) {
|
||||||
@ -516,7 +518,7 @@ Mempool.prototype.verify = function verify(tx, callback) {
|
|||||||
0));
|
0));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.freeCount += tx.getVirtualSize();
|
this.freeCount += tx.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.rejectInsaneFees && fee.cmp(minFee.muln(10000)) > 0)
|
if (this.rejectInsaneFees && fee.cmp(minFee.muln(10000)) > 0)
|
||||||
@ -543,16 +545,16 @@ Mempool.prototype.verify = function verify(tx, callback) {
|
|||||||
if (err)
|
if (err)
|
||||||
return callback(err);
|
return callback(err);
|
||||||
|
|
||||||
if (!result) {
|
if (result) {
|
||||||
return callback(new VerifyError(
|
return callback(new VerifyError(
|
||||||
'nonstandard',
|
'nonstandard',
|
||||||
'mandatory-script-verify-flag',
|
'non-mandatory-script-verify-flag',
|
||||||
0));
|
0));
|
||||||
}
|
}
|
||||||
|
|
||||||
return callback(new VerifyError(
|
return callback(new VerifyError(
|
||||||
'nonstandard',
|
'nonstandard',
|
||||||
'non-mandatory-script-verify-flag',
|
'mandatory-script-verify-flag',
|
||||||
0));
|
0));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user