aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader/downloader_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-06-18 05:26:54 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-06-18 05:26:54 +0800
commit55dd8fd6216e8880f441975f32eb070be5d401a2 (patch)
treeac79f1b1c2d4aaa16e477e7137a0a508b7ba762c /eth/downloader/downloader_test.go
parent2f4cbe22f5207b830f2685caae175cce70bcd231 (diff)
downloadgo-tangerine-55dd8fd6216e8880f441975f32eb070be5d401a2.tar
go-tangerine-55dd8fd6216e8880f441975f32eb070be5d401a2.tar.gz
go-tangerine-55dd8fd6216e8880f441975f32eb070be5d401a2.tar.bz2
go-tangerine-55dd8fd6216e8880f441975f32eb070be5d401a2.tar.lz
go-tangerine-55dd8fd6216e8880f441975f32eb070be5d401a2.tar.xz
go-tangerine-55dd8fd6216e8880f441975f32eb070be5d401a2.tar.zst
go-tangerine-55dd8fd6216e8880f441975f32eb070be5d401a2.zip
eth/downloader: always reenter processing if not exiting
Diffstat (limited to 'eth/downloader/downloader_test.go')
-rw-r--r--eth/downloader/downloader_test.go31
1 files changed, 15 insertions, 16 deletions
diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go
index f97e6077b..40f77e7db 100644
--- a/eth/downloader/downloader_test.go
+++ b/eth/downloader/downloader_test.go
@@ -749,22 +749,21 @@ func TestHashAttackerDropping(t *testing.T) {
result error
drop bool
}{
- {nil, false}, // Sync succeeded, all is well
- {errBusy, false}, // Sync is already in progress, no problem
- {errUnknownPeer, false}, // Peer is unknown, was already dropped, don't double drop
- {errBadPeer, true}, // Peer was deemed bad for some reason, drop it
- {errStallingPeer, true}, // Peer was detected to be stalling, drop it
- {errBannedHead, true}, // Peer's head hash is a known bad hash, drop it
- {errNoPeers, false}, // No peers to download from, soft race, no issue
- {errPendingQueue, false}, // There are blocks still cached, wait to exhaust, no issue
- {errTimeout, true}, // No hashes received in due time, drop the peer
- {errEmptyHashSet, true}, // No hashes were returned as a response, drop as it's a dead end
- {errPeersUnavailable, true}, // Nobody had the advertised blocks, drop the advertiser
- {errInvalidChain, true}, // Hash chain was detected as invalid, definitely drop
- {errCrossCheckFailed, true}, // Hash-origin failed to pass a block cross check, drop
- {errCancelHashFetch, false}, // Synchronisation was canceled, origin may be innocent, don't drop
- {errCancelBlockFetch, false}, // Synchronisation was canceled, origin may be innocent, don't drop
- {errCancelChainImport, false}, // Synchronisation was canceled, origin may be innocent, don't drop
+ {nil, false}, // Sync succeeded, all is well
+ {errBusy, false}, // Sync is already in progress, no problem
+ {errUnknownPeer, false}, // Peer is unknown, was already dropped, don't double drop
+ {errBadPeer, true}, // Peer was deemed bad for some reason, drop it
+ {errStallingPeer, true}, // Peer was detected to be stalling, drop it
+ {errBannedHead, true}, // Peer's head hash is a known bad hash, drop it
+ {errNoPeers, false}, // No peers to download from, soft race, no issue
+ {errPendingQueue, false}, // There are blocks still cached, wait to exhaust, no issue
+ {errTimeout, true}, // No hashes received in due time, drop the peer
+ {errEmptyHashSet, true}, // No hashes were returned as a response, drop as it's a dead end
+ {errPeersUnavailable, true}, // Nobody had the advertised blocks, drop the advertiser
+ {errInvalidChain, true}, // Hash chain was detected as invalid, definitely drop
+ {errCrossCheckFailed, true}, // Hash-origin failed to pass a block cross check, drop
+ {errCancelHashFetch, false}, // Synchronisation was canceled, origin may be innocent, don't drop
+ {errCancelBlockFetch, false}, // Synchronisation was canceled, origin may be innocent, don't drop
}
// Run the tests and check disconnection status
tester := newTester()