mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
eth/filters: deliver the same block logs if reorg occured
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
3b3eb5aab5
commit
43afa1e462
1 changed files with 4 additions and 5 deletions
|
|
@ -408,12 +408,11 @@ func (api *FilterAPI) histLogs(notifier notifier, rpcSub *rpc.Subscription, from
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case log := <-histLogs:
|
case log := <-histLogs:
|
||||||
if reorged {
|
// If ChainReorg is detected, we need to deliver the last block's full logs
|
||||||
continue
|
if !reorged || delivered == log.BlockNumber {
|
||||||
|
delivered = log.BlockNumber
|
||||||
|
notifier.Notify(rpcSub.ID, &log)
|
||||||
}
|
}
|
||||||
// TODO: deliver the same block logs
|
|
||||||
delivered = log.BlockNumber
|
|
||||||
notifier.Notify(rpcSub.ID, &log)
|
|
||||||
case <-rpcSub.Err(): // client send an unsubscribe request
|
case <-rpcSub.Err(): // client send an unsubscribe request
|
||||||
liveLogsSub.Unsubscribe()
|
liveLogsSub.Unsubscribe()
|
||||||
closeC <- struct{}{}
|
closeC <- struct{}{}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue