diff options
author | Péter Szilágyi <peterke@gmail.com> | 2019-03-07 19:06:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-07 19:06:36 +0800 |
commit | 2eed46dadff7892f71a87ca9cc4f9c6b34fddb6e (patch) | |
tree | c4bcc7ebdd6cbaa0ea9dfa98101b0daf7cce3611 | |
parent | 2fa9e99fc19d2804d2409ab5904f4c154e70e6cd (diff) | |
parent | 1612267a4bcb2f26ca623d7b19bb8a0c9a876455 (diff) | |
download | go-tangerine-2eed46dadff7892f71a87ca9cc4f9c6b34fddb6e.tar go-tangerine-2eed46dadff7892f71a87ca9cc4f9c6b34fddb6e.tar.gz go-tangerine-2eed46dadff7892f71a87ca9cc4f9c6b34fddb6e.tar.bz2 go-tangerine-2eed46dadff7892f71a87ca9cc4f9c6b34fddb6e.tar.lz go-tangerine-2eed46dadff7892f71a87ca9cc4f9c6b34fddb6e.tar.xz go-tangerine-2eed46dadff7892f71a87ca9cc4f9c6b34fddb6e.tar.zst go-tangerine-2eed46dadff7892f71a87ca9cc4f9c6b34fddb6e.zip |
Merge pull request #19232 from karalabe/dl-fix-local-drop-sync
eth/downloader: fix nil droppeer in state sync
-rw-r--r-- | eth/downloader/statesync.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/eth/downloader/statesync.go b/eth/downloader/statesync.go index 0675a91cd..f294600b3 100644 --- a/eth/downloader/statesync.go +++ b/eth/downloader/statesync.go @@ -310,7 +310,13 @@ func (s *stateSync) loop() (err error) { // 2 items are the minimum requested, if even that times out, we've no use of // this peer at the moment. log.Warn("Stalling state sync, dropping peer", "peer", req.peer.id) - s.d.dropPeer(req.peer.id) + if s.d.dropPeer == nil { + // The dropPeer method is nil when `--copydb` is used for a local copy. + // Timeouts can occur if e.g. compaction hits at the wrong time, and can be ignored + req.peer.log.Warn("Downloader wants to drop peer, but peerdrop-function is not set", "peer", req.peer.id) + } else { + s.d.dropPeer(req.peer.id) + } } // Process all the received blobs and check for stale delivery delivered, err := s.process(req) |