Skip to content

Commit

Permalink
Merge pull request #1467 from filecoin-project/fix/charge-gas
Browse files Browse the repository at this point in the history
use charge gas safe in places we return errors
  • Loading branch information
magik6k authored Mar 27, 2020
2 parents 4dcb810 + 19553a6 commit 6dddc42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chain/vm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6dddc42

Please sign in to comment.