diff --git a/lib/mempool/mempool.js b/lib/mempool/mempool.js index d7e30e26..c7ea18b0 100644 --- a/lib/mempool/mempool.js +++ b/lib/mempool/mempool.js @@ -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); + } } }