Skip to content

Commit b6ed3dc

Browse files
authored
fix: nil pointer when search fails (#1997)
* fix nil pointer when search fails * fix error message * fix RPC logging
1 parent 3a9ae32 commit b6ed3dc

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

cmd/boost/direct_deal.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,12 @@ var directDealAllocate = &cli.Command{
321321
eg.Go(func() error {
322322
wait, err := gapi.StateWaitMsg(ctx, m, uint64(cctx.Int("confidence")), 2000, true)
323323
if err != nil {
324-
return fmt.Errorf("timeout waiting for message to land on chain %s", wait.Message)
324+
return fmt.Errorf("timeout waiting for message to land on chain %s", m.String())
325325

326326
}
327327

328328
if wait.Receipt.ExitCode.IsError() {
329-
return fmt.Errorf("failed to execute message %s: %w", wait.Message, wait.Receipt.ExitCode)
329+
return fmt.Errorf("failed to execute message %s: %w", m.String(), wait.Receipt.ExitCode)
330330
}
331331
return nil
332332
})
@@ -687,12 +687,12 @@ If the client id different then claim can be extended up to maximum 5 years from
687687
eg.Go(func() error {
688688
wait, err := gapi.StateWaitMsg(ctx, m, uint64(cctx.Int("confidence")), 2000, true)
689689
if err != nil {
690-
return fmt.Errorf("timeout waiting for message to land on chain %s", wait.Message)
690+
return fmt.Errorf("timeout waiting for message to land on chain %s", m.String())
691691

692692
}
693693

694694
if wait.Receipt.ExitCode.IsError() {
695-
return fmt.Errorf("failed to execute message %s: %w", wait.Message, wait.Receipt.ExitCode)
695+
return fmt.Errorf("failed to execute message %s: %w", m.String(), wait.Receipt.ExitCode)
696696
}
697697
return nil
698698
})

cmd/boostd/import_direct_data.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ var importDirectDataCmd = &cli.Command{
114114
}
115115
alloc, err := lapi.StateGetAllocation(ctx, clientAddr, verifreg.AllocationId(allocationId), head.Key())
116116
if err != nil {
117-
return fmt.Errorf("getting claim details from chain: %w", err)
117+
return fmt.Errorf("getting allocation details from chain: %w", err)
118118
}
119119
if alloc == nil {
120120
return fmt.Errorf("no allocation found with ID %d", allocationId)

cmd/boostd/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ func before(cctx *cli.Context) error {
6969
_ = logging.SetLogLevel("piecedirectory", "INFO")
7070
_ = logging.SetLogLevel("sectorstatemgr", "INFO")
7171
_ = logging.SetLogLevel("migrations", "INFO")
72+
_ = logging.SetLogLevel("rpc", "ERROR")
7273

7374
if cliutil.IsVeryVerbose {
7475
_ = logging.SetLogLevel("boostd", "DEBUG")

0 commit comments

Comments
 (0)