Skip to content

Commit

Permalink
Merge bitcoin#11475: [rpc] mempoolinfo should take ::minRelayTxFee in…
Browse files Browse the repository at this point in the history
…to account

149dffd [rpc] mempoolinfo should take ::minRelayTxFee into account (Cristian Mircea Messel)

Pull request description:

  Fixes bitcoin#6941 following bitcoin#11410 (comment) 's suggestion

  This takes care of the mentioned ticket without changing the behavior of https://github.com/bitcoin/bitcoin/pull/11410/files#diff-24efdb00bfbe56b140fb006b562cc70bL629

  By modifying https://github.com/bitcoin/bitcoin/blob/5a9da37fb3f4b53f556e1d46509b94dc3c661d75/src/txmempool.cpp#L984 the syncing mempools becomes problematic as per bitcoin#11410 (comment)

  ~~Same code causes different tests to fail: https://travis-ci.org/bitcoin/bitcoin/jobs/286128241 https://travis-ci.org/bitcoin/bitcoin/jobs/286128241 . I can't reproduce the problems locally, am I doing something wrong?~~ travis sometimes fails unexpectedly

Tree-SHA512: fd81628da6a3eff51bd09e5342d781bac0710f79d6b330b1df3662756ecaceb2e1682bf9768b5f8edbcba6479a3223dfa6604d37c9e9d37d00d077172da4f6ea
  • Loading branch information
laanwj authored and PastaPastaPasta committed Jan 22, 2020
1 parent 690189b commit 3b2be13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/rpc/blockchain.cpp
Expand Up @@ -1645,7 +1645,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())));
ret.push_back(Pair("instantsendlocks", (int64_t)llmq::quorumInstantSendManager->GetInstantSendLockCount()));

return ret;
Expand Down
3 changes: 3 additions & 0 deletions test/functional/wallet.py
Expand Up @@ -36,6 +36,9 @@ def run_test(self):
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)
Expand Down

0 comments on commit 3b2be13

Please sign in to comment.