mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
eth/filters: shadow copy && reset reorglog
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
5600bbf03e
commit
1589685a59
1 changed files with 2 additions and 1 deletions
|
|
@ -399,6 +399,7 @@ func (api *FilterAPI) histLogs(notifier notifier, rpcSub *rpc.Subscription, from
|
|||
}
|
||||
case logs := <-reorgLogsCh:
|
||||
for _, log := range logs {
|
||||
log := log
|
||||
reorgLogs = append(reorgLogs, log)
|
||||
// Update the reorgBlock to the last removed log's block number or the first added log's
|
||||
if reorgBlock == 0 || log.Removed {
|
||||
|
|
@ -408,7 +409,7 @@ func (api *FilterAPI) histLogs(notifier notifier, rpcSub *rpc.Subscription, from
|
|||
reorged = reorgBlock < delivered
|
||||
// Reorg happens in the future
|
||||
if !reorged {
|
||||
reorgLogs = reorgLogs[:]
|
||||
reorgLogs = nil
|
||||
}
|
||||
case err := <-errChan:
|
||||
// Range filter is done or error, let's also stop the reorgLogs subscribe
|
||||
|
|
|
|||
Loading…
Reference in a new issue