eth/tracers: live trace treat 0 as the initial offset

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2024-11-07 01:43:48 +00:00
parent 0099e5e2b8
commit 82ba95f5e3

View file

@ -174,7 +174,12 @@ func newLive(cfg json.RawMessage, stack tracers.LiveApiRegister, backend tracing
}
latest := l.getFreezerTail()
offset := latest - tail - frozen
var offset uint64
if latest == 0 {
offset = 0
} else {
offset = latest - tail - frozen
}
log.Info("Open live tracer", "path", config.Path, "offset", offset, "tail", tail, "frozen", frozen, "latest", latest, "tables", tables)
// Initialize the latest block number as the sum of the tail, frozen, and offset