Skip to content

Commit

Permalink
fix: use right index when querying next Time record on stats (#1714)
Browse files Browse the repository at this point in the history
  • Loading branch information
sborrazas committed Mar 26, 2024
1 parent 21a6b8d commit 6aedb5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ae_mdw/stats.ex
Expand Up @@ -507,7 +507,7 @@ defmodule AeMdw.Stats do
{:ok, last_tx_index} = State.prev(state, Model.Tx, nil)
time_48hs_ago = time_24hs_ago - @seconds_per_day * 1_000

{:ok, {_time, tx_index_48hs_ago}} = State.next(state, Model.Time, time_48hs_ago)
{:ok, {_time, tx_index_48hs_ago}} = State.next(state, Model.Time, {time_48hs_ago, -1})

txs_count_24hs = last_tx_index - tx_index_24hs_ago
txs_count_48hs = tx_index_24hs_ago - tx_index_48hs_ago
Expand Down

0 comments on commit 6aedb5b

Please sign in to comment.