Merge pull request #11146

92c8206 rpc: redact txpool age in restricted mode (selsta)
265f7b2 txpool: fix time_in_pool age calculation (selsta)

ACKs: tobtoht, jpk68
This commit is contained in:
tobtoht
2026-08-25 16:39:10 +00:00
2 changed files with 7 additions and 1 deletions
+2 -1
View File
@@ -1075,7 +1075,8 @@ namespace cryptonote
const relay_category category = include_sensitive ? relay_category::all : relay_category::broadcasted;
backlog.reserve(m_blockchain.get_txpool_tx_count(include_sensitive));
m_blockchain.for_all_txpool_txes([&backlog, now](const crypto::hash &txid, const txpool_tx_meta_t &meta, const cryptonote::blobdata_ref *bd){
backlog.push_back({meta.weight, meta.fee, meta.receive_time - now});
const uint64_t age = now >= meta.receive_time ? now - meta.receive_time : 0;
backlog.push_back({meta.weight, meta.fee, age});
return true;
}, false, category);
}
+5
View File
@@ -2863,6 +2863,7 @@ namespace cryptonote
{
RPC_TRACKER(get_txpool_backlog);
const bool restricted = m_restricted && ctx;
if (!m_core.get_txpool_backlog(res.backlog))
{
error_resp.code = CORE_RPC_ERROR_CODE_INTERNAL_ERROR;
@@ -2870,6 +2871,10 @@ namespace cryptonote
return false;
}
if (restricted)
for (tx_backlog_entry& entry : res.backlog)
entry.time_in_pool = 0;
res.status = CORE_RPC_STATUS_OK;
return true;
}