Merge pull request #6807 from filecoin-project/nonsense/fetch-peerid-from-chain
ClientFindData: always fetch peer id from chain
This commit is contained in:
commit
c29f375a7a
@ -436,7 +436,19 @@ func (a *API) ClientFindData(ctx context.Context, root cid.Cid, piece *cid.Cid)
|
||||
if piece != nil && !piece.Equals(*p.PieceCID) {
|
||||
continue
|
||||
}
|
||||
out = append(out, a.makeRetrievalQuery(ctx, p, root, piece, rm.QueryParams{}))
|
||||
|
||||
// do not rely on local data with respect to peer id
|
||||
// fetch an up-to-date miner peer id from chain
|
||||
mi, err := a.StateMinerInfo(ctx, p.Address, types.EmptyTSK)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pp := rm.RetrievalPeer{
|
||||
Address: p.Address,
|
||||
ID: *mi.PeerId,
|
||||
}
|
||||
|
||||
out = append(out, a.makeRetrievalQuery(ctx, pp, root, piece, rm.QueryParams{}))
|
||||
}
|
||||
|
||||
return out, nil
|
||||
|
Loading…
Reference in New Issue
Block a user