@@ -1064,6 +1064,36 @@ static RPCHelpMan getmempoolinfo()
10641064 };
10651065}
10661066
1067+ static RPCHelpMan getextrapoolinfo ()
1068+ {
1069+ return RPCHelpMan{" getextrapoolinfo" ,
1070+ " Returns details about the extra tx pool used for compact block reconstruction.\n " ,
1071+ {},
1072+ RPCResult{
1073+ RPCResult::Type::OBJ, " " , " " ,
1074+ {
1075+ {RPCResult::Type::NUM, " count" , " Number of transactions in the extra pool" },
1076+ {RPCResult::Type::NUM, " bytes" , " Sum of virtual transaction size for all transactions in the extra pool" },
1077+ }},
1078+ RPCExamples{
1079+ HelpExampleCli (" getextrapoolinfo" , " " ) +
1080+ HelpExampleRpc (" getextrapoolinfo" , " " )
1081+ },
1082+ [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
1083+ {
1084+ const NodeContext& node = EnsureAnyNodeContext (request.context );
1085+ PeerManager& peerman = EnsurePeerman (node);
1086+
1087+ LOCK (::cs_main);
1088+
1089+ UniValue ret (UniValue::VOBJ);
1090+ ret.pushKV (" count" , (uint64_t )peerman.ExtraTxnForCompactCount ());
1091+ ret.pushKV (" bytes" , (uint64_t )peerman.ExtraTxnForCompactBytes ());
1092+ return ret;
1093+ },
1094+ };
1095+ }
1096+
10671097static RPCHelpMan importmempool ()
10681098{
10691099 return RPCHelpMan{
@@ -1480,6 +1510,7 @@ void RegisterMempoolRPCCommands(CRPCTable& t)
14801510 {" blockchain" , &getmempoolentry},
14811511 {" blockchain" , &gettxspendingprevout},
14821512 {" blockchain" , &getmempoolinfo},
1513+ {" blockchain" , &getextrapoolinfo},
14831514 {" blockchain" , &getrawmempool},
14841515 {" blockchain" , &importmempool},
14851516 {" blockchain" , &savemempool},
0 commit comments