From 66ee63f7271ba2078ec1f15b8d5e5e742abfa6cd Mon Sep 17 00:00:00 2001 From: Miya Chen Date: Wed, 9 Aug 2017 16:41:14 +0800 Subject: [PATCH] eth/fetcher: ignore block notification if already under fetching process --- eth/fetcher/fetcher.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eth/fetcher/fetcher.go b/eth/fetcher/fetcher.go index 98cc1a76b6..3a83a4936d 100644 --- a/eth/fetcher/fetcher.go +++ b/eth/fetcher/fetcher.go @@ -338,9 +338,15 @@ func (f *Fetcher) loop() { if _, ok := f.fetching[notification.hash]; ok { break } + if _, ok := f.fetched[notification.hash]; ok { + break + } if _, ok := f.completing[notification.hash]; ok { break } + if _, ok := f.queued[notification.hash]; ok { + break + } f.announces[notification.origin] = count f.announced[notification.hash] = append(f.announced[notification.hash], notification) if f.announceChangeHook != nil && len(f.announced[notification.hash]) == 1 {