rpc: fix incomplete range check in get_coinbase_tx_sum + update test

This commit is contained in:
Thomas
2026-04-28 21:32:12 +02:00
parent 94c2ed34c2
commit df2b8b4bf6
2 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -3076,9 +3076,9 @@ namespace cryptonote
{
RPC_TRACKER(get_coinbase_tx_sum);
const uint64_t bc_height = m_core.get_current_blockchain_height();
if (req.height >= bc_height || req.count > bc_height)
if (req.height >= bc_height || req.count > bc_height - req.height)
{
res.status = "height or count is too large";
res.status = "requested range exceeds blockchain height";
return true;
}
CHECK_PAYMENT_MIN1(req, res, COST_PER_COINBASE_TX_SUM_BLOCK * req.count, false);