Bugfix: Check if vmctx is nil before dereferencing in ApplyMessage

This commit is contained in:
Aayush Rajasekaran 2020-03-11 15:32:41 -04:00
parent d4c0dfa851
commit 4777ca21c3

View File

@ -532,15 +532,21 @@ func (vm *VM) ApplyMessage(ctx context.Context, msg *types.Message) (*ApplyRet,
return nil, xerrors.Errorf("gas handling math is wrong")
}
return &ApplyRet{
r := ApplyRet{
MessageReceipt: types.MessageReceipt{
ExitCode: errcode,
Return: ret,
GasUsed: gasUsed,
},
ActorErr: actorErr,
InternalExecutions: vmctx.internalExecutions,
}, nil
InternalExecutions: nil,
}
if vmctx != nil {
r.InternalExecutions = vmctx.internalExecutions
}
return &r, nil
}
func (vm *VM) SetBlockMiner(m address.Address) {