aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
Diffstat (limited to 'vm')
-rw-r--r--vm/vm.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/vm/vm.go b/vm/vm.go
index 165bb0329..837be8c4d 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -405,7 +405,12 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
case BALANCE:
addr := stack.Pop().Bytes()
- balance := statedb.GetBalance(addr)
+ var balance *big.Int
+ if statedb.GetStateObject(addr) != nil {
+ balance = statedb.GetBalance(addr)
+ } else {
+ balance = base
+ }
stack.Push(balance)