core/vm: fix post init metering

This commit is contained in:
Guillaume Ballet 2018-11-24 22:56:08 +01:00
parent ac0f688edd
commit 90f926cfce

View file

@ -244,7 +244,8 @@ func (in *InterpreterEWASM) PostContractCreation(code []byte) ([]byte, error) {
return nil, errExecutionReverted return nil, errExecutionReverted
} }
if in.metering { if in.metering {
code, _, err := sentinel(in, code) meteredCode, _, err := sentinel(in, code)
code = meteredCode
if len(code) < 5 || err != nil { if len(code) < 5 || err != nil {
return nil, fmt.Errorf("Error metering the generated contract code, err=%v", err) return nil, fmt.Errorf("Error metering the generated contract code, err=%v", err)
} }