mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
swarm/storage/localstore: fix a possible deadlock in tests
This commit is contained in:
parent
c580854f35
commit
09c184aa0e
1 changed files with 3 additions and 3 deletions
|
|
@ -473,14 +473,14 @@ func readPullSubscriptionBin(ctx context.Context, bin uint8, ch <-chan ChunkDesc
|
|||
if !ok {
|
||||
return
|
||||
}
|
||||
var err error
|
||||
addrsMu.Lock()
|
||||
if i+1 > len(addrs[bin]) {
|
||||
errChan <- fmt.Errorf("got more chunk addresses %v, then expected %v, for bin %v", i+1, len(addrs[bin]), bin)
|
||||
err = fmt.Errorf("got more chunk addresses %v, then expected %v, for bin %v", i+1, len(addrs[bin]), bin)
|
||||
}
|
||||
want := addrs[bin][i]
|
||||
addrsMu.Unlock()
|
||||
var err error
|
||||
if !bytes.Equal(got.Address, want) {
|
||||
if err == nil && !bytes.Equal(got.Address, want) {
|
||||
err = fmt.Errorf("got chunk address %v in bin %v %s, want %s", i, bin, got.Address.Hex(), want)
|
||||
}
|
||||
i++
|
||||
|
|
|
|||
Loading…
Reference in a new issue