Skip to content

Commit bcb0dd8

Browse files
committed
RPC/Mempool: Add dustrelayfee, dustrelayfeefloor, and dustdynamic to getmempoolinfo
1 parent 690811b commit bcb0dd8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/rpc/mempool.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,15 @@ UniValue MempoolInfoToJSON(const CTxMemPool& pool, const std::optional<MempoolHi
725725
ret.pushKV("mempoolminfee", ValueFromAmount(std::max(pool.GetMinFee(), pool.m_opts.min_relay_feerate).GetFeePerK()));
726726
ret.pushKV("minrelaytxfee", ValueFromAmount(pool.m_opts.min_relay_feerate.GetFeePerK()));
727727
ret.pushKV("incrementalrelayfee", ValueFromAmount(pool.m_opts.incremental_relay_feerate.GetFeePerK()));
728+
ret.pushKV("dustrelayfee", ValueFromAmount(pool.m_opts.dust_relay_feerate.GetFeePerK()));
729+
ret.pushKV("dustrelayfeefloor", ValueFromAmount(pool.m_opts.dust_relay_feerate_floor.GetFeePerK()));
730+
if (pool.m_opts.dust_relay_target < 0) {
731+
ret.pushKV("dustdynamic", strprintf("target:%u", -pool.m_opts.dust_relay_target));
732+
} else if (pool.m_opts.dust_relay_target > 0) {
733+
ret.pushKV("dustdynamic", strprintf("mempool:%u", pool.m_opts.dust_relay_target));
734+
} else {
735+
ret.pushKV("dustdynamic", "off");
736+
}
728737
ret.pushKV("unbroadcastcount", uint64_t{pool.GetUnbroadcastTxs().size()});
729738
ret.pushKV("fullrbf", (pool.m_opts.rbf_policy == RBFPolicy::Always));
730739
switch (pool.m_opts.rbf_policy) {
@@ -818,6 +827,9 @@ static RPCHelpMan getmempoolinfo()
818827
{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"},
819828
{RPCResult::Type::STR_AMOUNT, "minrelaytxfee", "Current minimum relay fee for transactions"},
820829
{RPCResult::Type::NUM, "incrementalrelayfee", "minimum fee rate increment for mempool limiting or replacement in " + CURRENCY_UNIT + "/kvB"},
830+
{RPCResult::Type::NUM, "dustrelayfee", "Current fee rate used to define dust, the value of an output so small it will cost more to spend than its value, in " + CURRENCY_UNIT + "/kvB"},
831+
{RPCResult::Type::NUM, "dustrelayfeefloor", "Minimum fee rate used to define dust in " + CURRENCY_UNIT + "/kvB"},
832+
{RPCResult::Type::STR, "dustdynamic", "Method for automatic adjustments to dustrelayfee (one of: off, target:<blocks>, or mempool:<kB>)"},
821833
{RPCResult::Type::NUM, "unbroadcastcount", "Current number of transactions that haven't passed initial broadcast yet"},
822834
{RPCResult::Type::BOOL, "fullrbf", "True if the mempool accepts RBF without replaceability signaling inspection"},
823835
{RPCResult::Type::STR, "rbf_policy", "Policy used for replacing conflicting transactions by fee (one of: never, optin, always)"},

0 commit comments

Comments
 (0)