@@ -480,6 +480,40 @@ static RPCHelpMan prioritisetransaction()
480480 };
481481}
482482
483+ static RPCHelpMan getprioritisedtransactions ()
484+ {
485+ return RPCHelpMan{" getprioritisedtransactions" ,
486+ " Returns a map of all user-created (see prioritisetransaction) fee deltas by txid, and whether the tx is present in mempool." ,
487+ {},
488+ RPCResult{
489+ RPCResult::Type::OBJ_DYN, " prioritisation-map" , " prioritisation keyed by txid" ,
490+ {
491+ {RPCResult::Type::OBJ, " txid" , " " , {
492+ {RPCResult::Type::NUM, " fee_delta" , " transaction fee delta in satoshis" },
493+ {RPCResult::Type::BOOL, " in_mempool" , " whether this transaction is currently in mempool" },
494+ }}
495+ },
496+ },
497+ RPCExamples{
498+ HelpExampleCli (" getprioritisedtransactions" , " " )
499+ + HelpExampleRpc (" getprioritisedtransactions" , " " )
500+ },
501+ [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
502+ {
503+ NodeContext& node = EnsureAnyNodeContext (request.context );
504+ CTxMemPool& mempool = EnsureMemPool (node);
505+ UniValue rpc_result{UniValue::VOBJ};
506+ for (const auto & delta_info : mempool.GetPrioritisedTransactions ()) {
507+ UniValue result_inner{UniValue::VOBJ};
508+ result_inner.pushKV (" fee_delta" , delta_info.delta );
509+ result_inner.pushKV (" in_mempool" , delta_info.in_mempool );
510+ rpc_result.pushKV (delta_info.txid .GetHex (), result_inner);
511+ }
512+ return rpc_result;
513+ },
514+ };
515+ }
516+
483517
484518// NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller
485519static UniValue BIP22ValidationResult (const BlockValidationState& state)
@@ -1048,6 +1082,7 @@ void RegisterMiningRPCCommands(CRPCTable& t)
10481082 {" mining" , &getnetworkhashps},
10491083 {" mining" , &getmininginfo},
10501084 {" mining" , &prioritisetransaction},
1085+ {" mining" , &getprioritisedtransactions},
10511086 {" mining" , &getblocktemplate},
10521087 {" mining" , &submitblock},
10531088 {" mining" , &submitheader},
0 commit comments