mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-23 04:03:49 +00:00
21 lines
494 B
Go
21 lines
494 B
Go
package rawdbhelpers
|
|
|
|
import (
|
|
"encoding/binary"
|
|
|
|
"github.com/ledgerwatch/erigon-lib/kv"
|
|
"github.com/ledgerwatch/erigon/eth/ethconfig"
|
|
)
|
|
|
|
func IdxStepsCountV3(tx kv.Tx) float64 {
|
|
fst, _ := kv.FirstKey(tx, kv.TblTracesToKeys)
|
|
lst, _ := kv.LastKey(tx, kv.TblTracesToKeys)
|
|
if len(fst) > 0 && len(lst) > 0 {
|
|
fstTxNum := binary.BigEndian.Uint64(fst)
|
|
lstTxNum := binary.BigEndian.Uint64(lst)
|
|
|
|
return float64(lstTxNum-fstTxNum) / float64(ethconfig.HistoryV3AggregationStep)
|
|
}
|
|
return 0
|
|
}
|