Skip to content

Commit

Permalink
fix: query chunk records from peers in routing tableif there is no gi…
Browse files Browse the repository at this point in the history
…ven peer
  • Loading branch information
yxq committed Jul 14, 2021
1 parent 6371fcf commit 5362c0a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions system/p2p/dht/protocol/p2pstore/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,16 @@ func (p *Protocol) getChunkRecords(param *types.ReqChunkRecords) *types.ChunkRec
log.Info("getChunkRecords", "peer", pid, "error", err, "start", param.Start, "end", param.End)
return records
}

for _, pid := range p.RoutingTable.ListPeers() {
records, err := p.getChunkRecordsFromPeer(param, pid)
if err != nil {
log.Error("getChunkRecords", "peer", pid, "error", err, "start", param.Start, "end", param.End)
continue
}
log.Info("getChunkRecords", "peer", pid, "error", err, "start", param.Start, "end", param.End)
return records
}
return nil
}

Expand Down

0 comments on commit 5362c0a

Please sign in to comment.