• Felix Lange's avatar
    eth/downloader: don't hang for spurious deliveries · 900da3d8
    Felix Lange authored
    Unexpected deliveries could block indefinitely if they arrived at the
    right time. The fix is to ensure that the cancellation channel is
    always closed when the sync ends, unblocking any deliveries. Also remove
    the atomic check for whether a sync is currently running because it
    doesn't help and can be misleading.
    
    Cancelling always seems to break the tests though. The downloader
    spawned d.process whenever new data arrived, making it somewhat hard to
    track when block processing was actually done. Fix this by running
    d.process in a dedicated goroutine that is tied to the lifecycle of the
    sync. d.process gets notified of new work by the queue instead of being
    invoked all the time. This removes a ton of weird workaround code,
    including a hairy use of atomic CAS.
    900da3d8
Name
Last commit
Last update
Godeps Loading commit data...
_data Loading commit data...
accounts Loading commit data...
build Loading commit data...
cmd Loading commit data...
common Loading commit data...
compression/rle Loading commit data...
core Loading commit data...
crypto Loading commit data...
docker Loading commit data...
errs Loading commit data...
eth Loading commit data...
ethdb Loading commit data...
event Loading commit data...
generators Loading commit data...
jsre Loading commit data...
logger Loading commit data...
metrics Loading commit data...
miner Loading commit data...
p2p Loading commit data...
params Loading commit data...
pow Loading commit data...
rlp Loading commit data...
rpc Loading commit data...
tests Loading commit data...
trie Loading commit data...
whisper Loading commit data...
xeth Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING Loading commit data...
COPYING.LESSER Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
VERSION Loading commit data...