mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
swarm/storage/localstore: better want check in readPullSubscriptionBin
This commit is contained in:
parent
0b80043abb
commit
7e7e5ef8dc
1 changed files with 5 additions and 4 deletions
|
|
@ -445,12 +445,13 @@ func readPullSubscriptionBin(ctx context.Context, bin uint8, ch <-chan ChunkDesc
|
|||
addrsMu.Lock()
|
||||
if i+1 > len(addrs[bin]) {
|
||||
err = fmt.Errorf("got more chunk addresses %v, then expected %v, for bin %v", i+1, len(addrs[bin]), bin)
|
||||
}
|
||||
} else {
|
||||
want := addrs[bin][i]
|
||||
addrsMu.Unlock()
|
||||
if err == nil && !bytes.Equal(got.Address, want) {
|
||||
if !bytes.Equal(got.Address, want) {
|
||||
err = fmt.Errorf("got chunk address %v in bin %v %s, want %s", i, bin, got.Address.Hex(), want)
|
||||
}
|
||||
}
|
||||
addrsMu.Unlock()
|
||||
i++
|
||||
// send one and only one error per received address
|
||||
select {
|
||||
|
|
|
|||
Loading…
Reference in a new issue