les: limit state ODR retrievals to the last 100 blocks (#17744)

This commit is contained in:
Felföldi Zsolt
2018-10-01 15:14:53 +02:00
committed by Martin Holst Swende
parent 96fd50be10
commit b7bbe66b19
5 changed files with 26 additions and 19 deletions

View File

@@ -194,7 +194,7 @@ func testOdr(t *testing.T, protocol int, expFail uint64, fn odrTestFn) {
client.peers.Register(client.rPeer)
time.Sleep(time.Millisecond * 10) // ensure that all peerSetNotify callbacks are executed
client.peers.lock.Lock()
client.rPeer.hasBlock = func(common.Hash, uint64) bool { return true }
client.rPeer.hasBlock = func(common.Hash, uint64, bool) bool { return true }
client.peers.lock.Unlock()
test(5)
// still expect all retrievals to pass, now data should be cached locally