mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-01 19:24:14 +08:00
refac(bitswap) nil slices are 'range'able
This commit is contained in:
@ -117,7 +117,6 @@ func (bs *bitswap) ReceiveMessage(
|
||||
|
||||
bs.strategy.MessageReceived(p, incoming)
|
||||
|
||||
if incoming.Blocks() != nil {
|
||||
for _, block := range incoming.Blocks() {
|
||||
err := bs.blockstore.Put(block) // FIXME(brian): err ignored
|
||||
if err != nil {
|
||||
@ -129,9 +128,7 @@ func (bs *bitswap) ReceiveMessage(
|
||||
return nil, nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if incoming.Wantlist() != nil {
|
||||
for _, key := range incoming.Wantlist() {
|
||||
if bs.strategy.ShouldSendBlockToPeer(key, p) {
|
||||
block, errBlockNotFound := bs.blockstore.Get(key)
|
||||
@ -144,7 +141,6 @@ func (bs *bitswap) ReceiveMessage(
|
||||
return p, message, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user