erigon-pulse/eth/downloader
Marius van der Wijden 12de9c3f65 eth/downloader: fixes data race between synchronize and other methods (#21201)
* eth/downloaded: fixed datarace between synchronize and Progress

There was a race condition between `downloader.synchronize()` and `Progress` `syncWithPeer` `fetchHeight` `findAncestors` and `processHeaders`
This PR changes the behavior of the downloader a bit.
Previously the functions `Progress` `syncWithPeer` `fetchHeight` `findAncestors` and `processHeaders` read the syncMode anew within their loops. Now they read the syncMode at the start of their function and don't change it during their runtime.

* eth/downloaded: comment

* eth/downloader: added comment
# Conflicts:
#	eth/downloader/downloader.go
2020-08-07 11:51:38 +02:00
..
api.go Apply Turbo-Geth modifications to go-ethereum codebase 2019-11-01 21:52:03 +01:00
downloader_stagedsync_test.go Jumpdest skip optimisation (#851) 2020-08-01 17:56:57 +01:00
downloader_stagedsync.go Various fixes to make sync work (#663) 2020-06-13 22:39:55 +01:00
downloader_test.go eth/downloader: fixes data race between synchronize and other methods (#21201) 2020-08-07 11:51:38 +02:00
downloader.go eth/downloader: fixes data race between synchronize and other methods (#21201) 2020-08-07 11:51:38 +02:00
events.go Apply Turbo-Geth modifications to go-ethereum codebase 2019-11-01 21:52:03 +01:00
fakepeer.go cmd/tester initiates staged sync, and unwind (but not reorg) (#758) 2020-07-19 09:11:53 +01:00
metrics.go Apply Turbo-Geth modifications to go-ethereum codebase 2019-11-01 21:52:03 +01:00
modes.go eth/downloader: fixes data race between synchronize and other methods (#21201) 2020-08-07 11:51:38 +02:00
peer.go eth/downloader: don't use defer for unlock before return (#21227) 2020-08-07 11:17:56 +02:00
queue.go eth/downloader: more context in errors (#21067) 2020-06-15 19:38:13 +03:00
testchain_test.go Ci lmdb - reduce memory usage (#762) 2020-07-21 08:58:00 +07:00
types.go Apply Turbo-Geth modifications to go-ethereum codebase 2019-11-01 21:52:03 +01:00