mirror of
https://github.com/wownero/wownero.git
synced 2026-10-17 15:41:44 +02:00
Merge pull request #11146
92c8206rpc: redact txpool age in restricted mode (selsta)265f7b2txpool: fix time_in_pool age calculation (selsta) ACKs: tobtoht, jpk68
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user