les: implement request distributor, fix blocking issues (#3660)
* les: implement request distributor, fix blocking issues * core: moved header validation before chain mutex lock
This commit is contained in:
committed by
Felix Lange
parent
1c1dc0e0fc
commit
525116dbff
@ -162,8 +162,11 @@ func testOdr(t *testing.T, protocol int, expFail uint64, fn odrTestFn) {
|
||||
lpm, ldb, odr := newTestProtocolManagerMust(t, true, 0, nil)
|
||||
_, err1, lpeer, err2 := newTestPeerPair("peer", protocol, pm, lpm)
|
||||
pool := &testServerPool{}
|
||||
lpm.reqDist = newRequestDistributor(pool.getAllPeers, lpm.quitSync)
|
||||
odr.reqDist = lpm.reqDist
|
||||
pool.setPeer(lpeer)
|
||||
odr.serverPool = pool
|
||||
lpeer.hasBlock = func(common.Hash, uint64) bool { return true }
|
||||
select {
|
||||
case <-time.After(time.Millisecond * 100):
|
||||
case err := <-err1:
|
||||
|
Reference in New Issue
Block a user