les: rework clientpool (#20077)

* les: rework clientpool
This commit is contained in:
gary rong
2019-11-02 20:02:35 +08:00
committed by Felföldi Zsolt
parent 44b74cfc40
commit 0ce5e113be
9 changed files with 976 additions and 268 deletions

View File

@@ -188,6 +188,12 @@ func testOdr(t *testing.T, protocol int, expFail uint64, checkCached bool, fn od
client.handler.synchronise(client.peer.peer)
// Ensure the client has synced all necessary data.
clientHead := client.handler.backend.blockchain.CurrentHeader()
if clientHead.Number.Uint64() != 4 {
t.Fatalf("Failed to sync the chain with server, head: %v", clientHead.Number.Uint64())
}
test := func(expFail uint64) {
// Mark this as a helper to put the failures at the correct lines
t.Helper()