forked from cerc-io/plugeth
core/vm: check for 'no code' before doing any work
This commit is contained in:
parent
ea2718c946
commit
48fb0c3213
@ -71,6 +71,11 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Don't bother with the execution if there's no code.
|
||||
if len(code) == 0 {
|
||||
return context.Return(nil), nil
|
||||
}
|
||||
|
||||
var (
|
||||
op OpCode
|
||||
codehash = crypto.Sha3Hash(code)
|
||||
@ -94,11 +99,6 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
|
||||
}
|
||||
)
|
||||
|
||||
// Don't bother with the execution if there's no code.
|
||||
if len(code) == 0 {
|
||||
return context.Return(nil), nil
|
||||
}
|
||||
|
||||
for {
|
||||
// The base for all big integer arithmetic
|
||||
base := new(big.Int)
|
||||
|
Loading…
Reference in New Issue
Block a user