From 5668e19c7eed27f8945f549bbdbd6336c9e19e73 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 22 Oct 2016 12:21:31 -0700 Subject: [PATCH] mempool: rbf option. --- lib/mempool/mempool.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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); + } } }