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:
|
||||
if reorged {
|
||||
continue
|
||||
}
|
||||
// TODO: deliver the same block logs
|
||||
// If ChainReorg is detected, we need to deliver the last block's full logs
|
||||
if !reorged || delivered == log.BlockNumber {
|
||||
delivered = log.BlockNumber
|
||||
notifier.Notify(rpcSub.ID, &log)
|
||||
}
|
||||
case <-rpcSub.Err(): // client send an unsubscribe request
|
||||
liveLogsSub.Unsubscribe()
|
||||
closeC <- struct{}{}
|
||||
|
|
|
|||
Loading…
Reference in a new issue