mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
core/filtermaps: fixed tail unindexing condition for epoch 0
This commit is contained in:
parent
d7770b3102
commit
b919bf009b
1 changed files with 6 additions and 4 deletions
|
|
@ -356,16 +356,18 @@ func (f *FilterMaps) needTailEpoch(epoch uint32) bool {
|
|||
if epoch+1 < firstEpoch {
|
||||
return false
|
||||
}
|
||||
var lastBlockOfPrevEpoch uint64
|
||||
if epoch > 0 {
|
||||
lastBlockOfPrevEpoch, _, err := f.getLastBlockOfMap(epoch<<f.logMapsPerEpoch - 1)
|
||||
var err error
|
||||
lastBlockOfPrevEpoch, _, err = f.getLastBlockOfMap(epoch<<f.logMapsPerEpoch - 1)
|
||||
if err != nil {
|
||||
log.Error("Could not get last block of previous epoch", "epoch", epoch-1, "error", err)
|
||||
return epoch >= firstEpoch
|
||||
}
|
||||
}
|
||||
if f.historyCutoff > lastBlockOfPrevEpoch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
lastBlockOfEpoch, _, err := f.getLastBlockOfMap((epoch+1)<<f.logMapsPerEpoch - 1)
|
||||
if err != nil {
|
||||
log.Error("Could not get last block of epoch", "epoch", epoch, "error", err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue