@@ -480,6 +480,40 @@ static RPCHelpMan prioritisetransaction()
480
480
};
481
481
}
482
482
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
+
483
517
484
518
// NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller
485
519
static UniValue BIP22ValidationResult (const BlockValidationState& state)
@@ -1048,6 +1082,7 @@ void RegisterMiningRPCCommands(CRPCTable& t)
1048
1082
{" mining" , &getnetworkhashps},
1049
1083
{" mining" , &getmininginfo},
1050
1084
{" mining" , &prioritisetransaction},
1085
+ {" mining" , &getprioritisedtransactions},
1051
1086
{" mining" , &getblocktemplate},
1052
1087
{" mining" , &submitblock},
1053
1088
{" mining" , &submitheader},
0 commit comments