mirror of
https://github.com/wownero/wownero.git
synced 2026-11-14 04:13:54 +01:00
rpc: fix incomplete range check in get_coinbase_tx_sum + update test
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user