Merge pull request #1934 from filecoin-project/bugs/return-on-error-#1611
fix unhandled nil return
This commit is contained in:
commit
9f4ac4f4f3
@ -58,22 +58,26 @@ func (pm *Manager) waitForPaychCreateMsg(ctx context.Context, mcid cid.Cid) {
|
||||
mwait, err := pm.state.StateWaitMsg(ctx, mcid)
|
||||
if err != nil {
|
||||
log.Errorf("wait msg: %w", err)
|
||||
return
|
||||
}
|
||||
|
||||
if mwait.Receipt.ExitCode != 0 {
|
||||
log.Errorf("payment channel creation failed (exit code %d)", mwait.Receipt.ExitCode)
|
||||
return
|
||||
}
|
||||
|
||||
var decodedReturn init_.ExecReturn
|
||||
err = decodedReturn.UnmarshalCBOR(bytes.NewReader(mwait.Receipt.Return))
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
paychaddr := decodedReturn.RobustAddress
|
||||
|
||||
ci, err := pm.loadOutboundChannelInfo(ctx, paychaddr)
|
||||
if err != nil {
|
||||
log.Errorf("loading channel info: %w", err)
|
||||
return
|
||||
}
|
||||
|
||||
if err := pm.store.trackChannel(ci); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user