aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-06 02:51:25 +0800
committerobscuren <geffobscura@gmail.com>2015-03-06 02:51:25 +0800
commit88ff13c241faff1d58e47f12bd283c112de7225a (patch)
treeb7bd2595ba702c086d8226cca4adaeeee0505bd5 /vm
parentca1093f8485595b34781307eb2b673d0d81d8fb9 (diff)
downloadgo-tangerine-88ff13c241faff1d58e47f12bd283c112de7225a.tar
go-tangerine-88ff13c241faff1d58e47f12bd283c112de7225a.tar.gz
go-tangerine-88ff13c241faff1d58e47f12bd283c112de7225a.tar.bz2
go-tangerine-88ff13c241faff1d58e47f12bd283c112de7225a.tar.lz
go-tangerine-88ff13c241faff1d58e47f12bd283c112de7225a.tar.xz
go-tangerine-88ff13c241faff1d58e47f12bd283c112de7225a.tar.zst
go-tangerine-88ff13c241faff1d58e47f12bd283c112de7225a.zip
Spec changes.
* All errors during state transition result in an invalid tx
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 bce8088ef..ff4692ec8 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -408,7 +408,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)