Skip to content

Commit f52d074

Browse files
author
MacroFake
committed
Merge bitcoin/bitcoin#25439: rpc: Return incrementalrelayfee in getmempoolinfo
fafee78 rpc: Return incrementalrelayfee in getmempoolinfo (MacroFake) Pull request description: Seems odd to return other policy info, but not the incremental relay fee ACKs for top commit: 1440000bytes: ACK bitcoin/bitcoin@fafee78 w0xlt: Code Review ACK bitcoin/bitcoin@fafee78 jarolrod: tACK fafee78 Tree-SHA512: faad0af6c039b8257acbeac913bc5dcdb2ea2db304c95e52601536c8de60eb1186e9fbb4a64a68adf476605f18022aeda16a5644a0d7912592b0977e4c029638
2 parents c1acd34 + fafee78 commit f52d074

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/rpc/mempool.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,14 +661,15 @@ UniValue MempoolInfoToJSON(const CTxMemPool& pool)
661661
ret.pushKV("maxmempool", maxmempool);
662662
ret.pushKV("mempoolminfee", ValueFromAmount(std::max(pool.GetMinFee(maxmempool), ::minRelayTxFee).GetFeePerK()));
663663
ret.pushKV("minrelaytxfee", ValueFromAmount(::minRelayTxFee.GetFeePerK()));
664+
ret.pushKV("incrementalrelayfee", ValueFromAmount(::incrementalRelayFee.GetFeePerK()));
664665
ret.pushKV("unbroadcastcount", uint64_t{pool.GetUnbroadcastTxs().size()});
665666
return ret;
666667
}
667668

668669
static RPCHelpMan getmempoolinfo()
669670
{
670671
return RPCHelpMan{"getmempoolinfo",
671-
"\nReturns details on the active state of the TX memory pool.\n",
672+
"Returns details on the active state of the TX memory pool.",
672673
{},
673674
RPCResult{
674675
RPCResult::Type::OBJ, "", "",
@@ -681,7 +682,8 @@ static RPCHelpMan getmempoolinfo()
681682
{RPCResult::Type::NUM, "maxmempool", "Maximum memory usage for the mempool"},
682683
{RPCResult::Type::STR_AMOUNT, "mempoolminfee", "Minimum fee rate in " + CURRENCY_UNIT + "/kvB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee"},
683684
{RPCResult::Type::STR_AMOUNT, "minrelaytxfee", "Current minimum relay fee for transactions"},
684-
{RPCResult::Type::NUM, "unbroadcastcount", "Current number of transactions that haven't passed initial broadcast yet"}
685+
{RPCResult::Type::NUM, "incrementalrelayfee", "minimum fee rate increment for mempool limiting or BIP 125 replacement in " + CURRENCY_UNIT + "/kvB"},
686+
{RPCResult::Type::NUM, "unbroadcastcount", "Current number of transactions that haven't passed initial broadcast yet"},
685687
}},
686688
RPCExamples{
687689
HelpExampleCli("getmempoolinfo", "")

test/functional/feature_rbf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,7 @@ def test_replacement_relay_fee(self):
711711

712712
# Higher fee, higher feerate, different txid, but the replacement does not provide a relay
713713
# fee conforming to node's `incrementalrelayfee` policy of 1000 sat per KB.
714+
assert_equal(self.nodes[0].getmempoolinfo()["incrementalrelayfee"], Decimal("0.00001"))
714715
tx.vout[0].nValue -= 1
715716
assert_raises_rpc_error(-26, "insufficient fee", self.nodes[0].sendrawtransaction, tx.serialize().hex())
716717

0 commit comments

Comments
 (0)