Merge pull request #1467 from filecoin-project/fix/charge-gas
use charge gas safe in places we return errors
This commit is contained in:
commit
cba97000c8
@ -210,7 +210,9 @@ func (vm *VM) send(ctx context.Context, msg *types.Message, parent *Runtime,
|
||||
}()
|
||||
}
|
||||
|
||||
rt.ChargeGas(rt.Pricelist().OnMethodInvocation(msg.Value, msg.Method))
|
||||
if aerr := rt.chargeGasSafe(rt.Pricelist().OnMethodInvocation(msg.Value, msg.Method)); aerr != nil {
|
||||
return nil, aerrors.Wrap(aerr, "not enough gas for method invocation"), rt
|
||||
}
|
||||
|
||||
toActor, err := st.GetActor(msg.To)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user