Skip to content

Commit a9a49e6

Browse files
committed
Merge #12001: [RPC] Adding ::minRelayTxFee amount to getmempoolinfo and updating help
aad3090 [rpc] Adding ::minRelayTxFee amount to getmempoolinfo and updating mempoolminfee help description (Jeff Rade) Pull request description: These are RPC document changes from #11475 which is now merged. Took into consideration comments from #11475 and #6941 for this PR. Biggest change here is when calling `getmempoolinfo`, will now show the `minrelaytxfee` in the JSON reponse (see below): ``` $ bitcoin-cli getmempoolinfo { "size": 50, "bytes": 13102, "usage": 70480, "maxmempool": 300000000, "mempoolminfee": 0.00001000, "minrelaytxfee": 0.00001000 } ``` Fixes #8953 Tree-SHA512: 5ca583961365ee1cfe6e0d19afb0b41d542e179efee3b3c5f3fcf7d3ebca9cc3eedfd1434a0da40c5eed84fba98b35646fda201e6e61c689b58bee9cbea44b9e
2 parents eeb6d52 + aad3090 commit a9a49e6

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

src/rpc/blockchain.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,6 +1358,7 @@ UniValue mempoolInfoToJSON()
13581358
size_t maxmempool = gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000;
13591359
ret.push_back(Pair("maxmempool", (int64_t) maxmempool));
13601360
ret.push_back(Pair("mempoolminfee", ValueFromAmount(std::max(mempool.GetMinFee(maxmempool), ::minRelayTxFee).GetFeePerK())));
1361+
ret.push_back(Pair("minrelaytxfee", ValueFromAmount(::minRelayTxFee.GetFeePerK())));
13611362

13621363
return ret;
13631364
}
@@ -1374,7 +1375,8 @@ UniValue getmempoolinfo(const JSONRPCRequest& request)
13741375
" \"bytes\": xxxxx, (numeric) Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted\n"
13751376
" \"usage\": xxxxx, (numeric) Total memory usage for the mempool\n"
13761377
" \"maxmempool\": xxxxx, (numeric) Maximum memory usage for the mempool\n"
1377-
" \"mempoolminfee\": xxxxx (numeric) Minimum fee rate in " + CURRENCY_UNIT + "/kB for tx to be accepted\n"
1378+
" \"mempoolminfee\": xxxxx (numeric) Minimum fee rate in " + CURRENCY_UNIT + "/kB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee\n"
1379+
" \"minrelaytxfee\": xxxxx (numeric) Current minimum relay fee for transactions\n"
13781380
"}\n"
13791381
"\nExamples:\n"
13801382
+ HelpExampleCli("getmempoolinfo", "")

test/functional/mempool_limit.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ def run_test(self):
1717
txouts = gen_return_txouts()
1818
relayfee = self.nodes[0].getnetworkinfo()['relayfee']
1919

20+
self.log.info('Check that mempoolminfee is minrelytxfee')
21+
assert_equal(self.nodes[0].getmempoolinfo()['minrelaytxfee'], Decimal('0.00001000'))
22+
assert_equal(self.nodes[0].getmempoolinfo()['mempoolminfee'], Decimal('0.00001000'))
23+
2024
txids = []
2125
utxos = create_confirmed_utxos(relayfee, self.nodes[0], 91)
2226

23-
#create a mempool tx that will be evicted
27+
self.log.info('Create a mempool tx that will be evicted')
2428
us0 = utxos.pop()
2529
inputs = [{ "txid" : us0["txid"], "vout" : us0["vout"]}]
2630
outputs = {self.nodes[0].getnewaddress() : 0.0001}
@@ -37,10 +41,14 @@ def run_test(self):
3741
txids.append([])
3842
txids[i] = create_lots_of_big_transactions(self.nodes[0], txouts, utxos[30*i:30*i+30], 30, (i+1)*base_fee)
3943

40-
# by now, the tx should be evicted, check confirmation state
44+
self.log.info('The tx should be evicted by now')
4145
assert(txid not in self.nodes[0].getrawmempool())
4246
txdata = self.nodes[0].gettransaction(txid)
4347
assert(txdata['confirmations'] == 0) #confirmation should still be 0
4448

49+
self.log.info('Check that mempoolminfee is larger than minrelytxfee')
50+
assert_equal(self.nodes[0].getmempoolinfo()['minrelaytxfee'], Decimal('0.00001000'))
51+
assert_greater_than(self.nodes[0].getmempoolinfo()['mempoolminfee'], Decimal('0.00001000'))
52+
4553
if __name__ == '__main__':
4654
MempoolLimitTest().main()

test/functional/wallet.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ def run_test(self):
3333
assert_equal(len(self.nodes[1].listunspent()), 0)
3434
assert_equal(len(self.nodes[2].listunspent()), 0)
3535

36-
self.log.info("Check for mempoolminfee in getmempoolinfo")
37-
assert_equal(self.nodes[0].getmempoolinfo()['mempoolminfee'], Decimal('0.00001000'))
38-
3936
self.log.info("Mining blocks...")
4037

4138
self.nodes[0].generate(1)

0 commit comments

Comments
 (0)