Skip to content

Commit

Permalink
Fix #8095
Browse files Browse the repository at this point in the history
Clear the list of miner addresses and successfull get-asked before asking for new ones
Previous behavior : if get-ask failed for miner(s), the faulty miner will be retried each time,
so you have to stop the command and start again to change this faulty miner (instead of removing from the list on the new attempt)
  • Loading branch information
FlorianRuen committed Feb 18, 2022
1 parent 93bc3af commit 1c39730
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,8 @@ uiLoop:

state = "miner"
case "miner":
maddrs = maddrs[:0]
ask = ask[:0]
afmt.Print("Miner Addresses (f0.. f0..), none to find: ")

_maddrsStr, _, err := rl.ReadLine()
Expand Down Expand Up @@ -802,7 +804,8 @@ uiLoop:

dealCount, err = strconv.ParseInt(string(dealcStr), 10, 64)
if err != nil {
return err
printErr(xerrors.Errorf("reading deal count: invalid number"))
continue
}

color.Blue(".. Picking miners")
Expand Down Expand Up @@ -859,12 +862,13 @@ uiLoop:

a, err := api.ClientQueryAsk(ctx, *mi.PeerId, maddr)
if err != nil {
printErr(xerrors.Errorf("failed to query ask: %w", err))
printErr(xerrors.Errorf("failed to query ask for miner %s: %w", maddr.String(), err))
state = "miner"
continue uiLoop
}

ask = append(ask, *a)

}

// TODO: run more validation
Expand Down

0 comments on commit 1c39730

Please sign in to comment.