eth/downloader: enable unsync-protection for light client (#19496)
* eth/downloader: enable unsync-protection for light client * eth/downloader: fix tests
This commit is contained in:
committed by
Péter Szilágyi
parent
6269e5574c
commit
749ccab9a4
@ -1594,13 +1594,13 @@ func testCheckpointEnforcement(t *testing.T, protocol int, mode SyncMode) {
|
||||
tester.newPeer("peer", protocol, chain)
|
||||
|
||||
var expect error
|
||||
if mode == FastSync {
|
||||
if mode == FastSync || mode == LightSync {
|
||||
expect = errUnsyncedPeer
|
||||
}
|
||||
if err := tester.sync("peer", nil, mode); err != expect {
|
||||
t.Fatalf("block sync error mismatch: have %v, want %v", err, expect)
|
||||
}
|
||||
if mode == FastSync {
|
||||
if mode == FastSync || mode == LightSync {
|
||||
assertOwnChain(t, tester, 1)
|
||||
} else {
|
||||
assertOwnChain(t, tester, chain.len())
|
||||
|
Reference in New Issue
Block a user