Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: peer id is nil #474

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ func (a *API) dealStarter(ctx context.Context, params *types.DealParams, isState
if err != nil {
return nil, fmt.Errorf("failed getting peer ID: %w", err)
}
if mi.PeerId == nil {
return nil, fmt.Errorf("miner %s has no peer id", params.Miner)
}

md, err := a.Full.StateMinerProvingDeadline(ctx, params.Miner, vTypes.EmptyTSK)
if err != nil {
Expand Down Expand Up @@ -529,6 +532,9 @@ func (a *API) ClientMinerQueryOffer(ctx context.Context, miner address.Address,
if err != nil {
return types.QueryOffer{}, err
}
if mi.PeerId == nil {
return types.QueryOffer{}, fmt.Errorf("miner %s has no peer id", miner)
}
rp := retrievalmarket.RetrievalPeer{
Address: miner,
ID: *mi.PeerId,
Expand Down Expand Up @@ -857,6 +863,9 @@ func (a *API) doRetrieval(ctx context.Context, order types.RetrievalOrder, sel d
if err != nil {
return 0, err
}
if mi.PeerId == nil {
return 0, fmt.Errorf("miner %s has no peer id", order.Miner)
}

order.MinerPeer = &retrievalmarket.RetrievalPeer{
ID: *mi.PeerId,
Expand Down
Loading