mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 21:26:42 +00:00
eth/filters: history logs should be requested > head
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
b9f695cef8
commit
77aa3cc663
1 changed files with 4 additions and 2 deletions
|
|
@ -366,6 +366,7 @@ func (api *FilterAPI) histLogs(notifier notifier, rpcSub *rpc.Subscription, from
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Else historical logs are all delivered, let's switch to live mode
|
// Else historical logs are all delivered, let's switch to live mode
|
||||||
|
logger.Info("History logs delivery finished, and now enter into live mode", "delivered", delivered)
|
||||||
liveOnly = true
|
liveOnly = true
|
||||||
histLogs = nil
|
histLogs = nil
|
||||||
case logs := <-liveLogs:
|
case logs := <-liveLogs:
|
||||||
|
|
@ -441,7 +442,8 @@ func (api *FilterAPI) doHistLogs(from int64, crit FilterCriteria, histLogs chan<
|
||||||
return errors.New("unexpected error: no header block found")
|
return errors.New("unexpected error: no header block found")
|
||||||
}
|
}
|
||||||
head := header.Number.Int64()
|
head := header.Number.Int64()
|
||||||
if from >= head {
|
if from > head {
|
||||||
|
logger.Info("Finish historical sync", "from", from, "head", head)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -459,7 +461,7 @@ func (api *FilterAPI) doHistLogs(from int64, crit FilterCriteria, histLogs chan<
|
||||||
case err := <-errChan:
|
case err := <-errChan:
|
||||||
// Range filter is done or error, let's also stop the reorgLogs subscribe
|
// Range filter is done or error, let's also stop the reorgLogs subscribe
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("error while fetching historical logs", "err", err)
|
logger.Error("Error while fetching historical logs", "err", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
break FORLOOP
|
break FORLOOP
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue