From 149dffd3b2a137d575ad19b8c0b13345efe3ada1 Mon Sep 17 00:00:00 2001 From: Cristian Mircea Messel Date: Tue, 10 Oct 2017 19:36:27 +0300 Subject: [PATCH] [rpc] mempoolinfo should take ::minRelayTxFee into account --- src/rpc/blockchain.cpp | 2 +- test/functional/wallet.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 68af376f3..874645f65 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1345,7 +1345,7 @@ UniValue mempoolInfoToJSON() ret.push_back(Pair("usage", (int64_t) mempool.DynamicMemoryUsage())); size_t maxmempool = gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; ret.push_back(Pair("maxmempool", (int64_t) maxmempool)); - ret.push_back(Pair("mempoolminfee", ValueFromAmount(mempool.GetMinFee(maxmempool).GetFeePerK()))); + ret.push_back(Pair("mempoolminfee", ValueFromAmount(std::max(mempool.GetMinFee(maxmempool), ::minRelayTxFee).GetFeePerK()))); return ret; } diff --git a/test/functional/wallet.py b/test/functional/wallet.py index 9d8ae5035..d0ca24119 100755 --- a/test/functional/wallet.py +++ b/test/functional/wallet.py @@ -33,6 +33,9 @@ class WalletTest(BitcoinTestFramework): assert_equal(len(self.nodes[1].listunspent()), 0) assert_equal(len(self.nodes[2].listunspent()), 0) + self.log.info("Check for mempoolminfee in getmempoolinfo") + assert_equal(self.nodes[0].getmempoolinfo()['mempoolminfee'], Decimal('0.00001000')) + self.log.info("Mining blocks...") self.nodes[0].generate(1)