Skip to content

Commit c9943d4

Browse files
committed
fix allocate
1 parent 5758e6f commit c9943d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/sptool/toolbox_deal_tools.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,17 +495,17 @@ var allocateCmd = &cli.Command{
495495

496496
pieceFile := cctx.String("piece-file")
497497
miners := cctx.StringSlice("miner")
498-
pcids := cctx.StringSlice("piece-cid")
498+
pcids := cctx.String("piece-cid")
499499

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

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

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

0 commit comments

Comments
 (0)