Skip to content

Commit

Permalink
fix allocate
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr committed Feb 24, 2025
1 parent 5758e6f commit c9943d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/sptool/toolbox_deal_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,17 +495,17 @@ var allocateCmd = &cli.Command{

pieceFile := cctx.String("piece-file")
miners := cctx.StringSlice("miner")
pcids := cctx.StringSlice("piece-cid")
pcids := cctx.String("piece-cid")

if pieceFile == "" && len(pcids) < 1 {
if pieceFile == "" && pcids == "" {
return fmt.Errorf("must provide at least one --piece-cid or use --piece-file")
}

if pieceFile == "" && len(miners) < 1 {
return fmt.Errorf("must provide at least one miner address or use --piece-file")
}

if pieceFile != "" && len(pcids) > 0 {
if pieceFile != "" && pcids != "" {
return fmt.Errorf("cannot use both --piece-cid and --piece-file flags at once")
}

Expand Down

0 comments on commit c9943d4

Please sign in to comment.