mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 21:26:42 +00:00
eth/filters: header is nullable
Signed-off-by: Delweng <delweng@gmail.com>
This commit is contained in:
parent
88ac691d01
commit
f50087ebc7
1 changed files with 5 additions and 1 deletions
|
|
@ -316,7 +316,11 @@ func (api *FilterAPI) histLogs(ctx context.Context, notifier notifier, rpcSub *r
|
||||||
)
|
)
|
||||||
for {
|
for {
|
||||||
// get the latest block header
|
// get the latest block header
|
||||||
head := api.sys.backend.CurrentHeader().Number.Int64()
|
header := api.sys.backend.CurrentHeader()
|
||||||
|
if header == nil {
|
||||||
|
return 0, errors.New("header is null")
|
||||||
|
}
|
||||||
|
head := header.Number.Int64()
|
||||||
if n >= head {
|
if n >= head {
|
||||||
return head, nil
|
return head, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue