mempool: rbf option.

This commit is contained in:
Christopher Jeffrey 2016-10-22 12:21:31 -07:00
parent f735c7da83
commit 5668e19c7e
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -106,6 +106,7 @@ function Mempool(options) {
this.rejectAbsurdFees = this.options.rejectAbsurdFees !== false;
this.prematureWitness = !!this.options.prematureWitness;
this.paranoid = !!this.options.paranoid;
this.replaceByFee = !!this.options.replaceByFee;
this.maxSize = options.maxSize || constants.mempool.MAX_MEMPOOL_SIZE;
this.expiryTime = options.expiryTime || constants.mempool.MEMPOOL_EXPIRY;
@ -647,11 +648,13 @@ Mempool.prototype._addTX = co(function* _addTX(tx) {
ret.reason,
ret.score);
}
if (tx.isRBF()) {
throw new VerifyError(tx,
'nonstandard',
'replace-by-fee',
0);
if (!this.replaceByFee) {
if (tx.isRBF()) {
throw new VerifyError(tx,
'nonstandard',
'replace-by-fee',
0);
}
}
}