diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-01-09 22:58:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-09 22:58:23 +0800 |
commit | 681b51aac46fa11c235e9ac1af1228e0105a0720 (patch) | |
tree | ecbd5467a5f7356b2386189a67b8629663068cec /les/request_test.go | |
parent | 4268cb8efecceaf506e1b0b71e06714a838a49a8 (diff) | |
parent | 66979aa468b6329aabf49542bd3db14e59010c20 (diff) | |
download | go-tangerine-681b51aac46fa11c235e9ac1af1228e0105a0720.tar go-tangerine-681b51aac46fa11c235e9ac1af1228e0105a0720.tar.gz go-tangerine-681b51aac46fa11c235e9ac1af1228e0105a0720.tar.bz2 go-tangerine-681b51aac46fa11c235e9ac1af1228e0105a0720.tar.lz go-tangerine-681b51aac46fa11c235e9ac1af1228e0105a0720.tar.xz go-tangerine-681b51aac46fa11c235e9ac1af1228e0105a0720.tar.zst go-tangerine-681b51aac46fa11c235e9ac1af1228e0105a0720.zip |
Merge pull request #3519 from zsfelfoldi/light-topic5
les: fixed selectPeer deadlock, improved request distribution
Diffstat (limited to 'les/request_test.go')
-rw-r--r-- | les/request_test.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/les/request_test.go b/les/request_test.go index 03b946771..10e9edf8b 100644 --- a/les/request_test.go +++ b/les/request_test.go @@ -71,7 +71,8 @@ func testAccess(t *testing.T, protocol int, fn accessTestFn) { pm, db, _ := newTestProtocolManagerMust(t, false, 4, testChainGen) lpm, ldb, odr := newTestProtocolManagerMust(t, true, 0, nil) _, err1, lpeer, err2 := newTestPeerPair("peer", protocol, pm, lpm) - pool := (*testServerPool)(lpeer) + pool := &testServerPool{} + pool.setPeer(lpeer) odr.serverPool = pool select { case <-time.After(time.Millisecond * 100): @@ -102,10 +103,10 @@ func testAccess(t *testing.T, protocol int, fn accessTestFn) { } // temporarily remove peer to test odr fails - odr.serverPool = nil + pool.setPeer(nil) // expect retrievals to fail (except genesis block) without a les peer test(0) - odr.serverPool = pool + pool.setPeer(lpeer) // expect all retrievals to pass test(5) } |