aboutsummaryrefslogtreecommitdiffstats
path: root/vm/vm.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-09 18:28:35 +0800
committerobscuren <geffobscura@gmail.com>2015-03-09 18:28:35 +0800
commit19efebe91e354ad86c171e01c47f9c2f3ef5cf9f (patch)
treea35203550c3e6bec84ee47cebb94e5e93eecd3d8 /vm/vm.go
parent93cdffca3ad23eedae6f0591e1357c2429b31811 (diff)
downloaddexon-19efebe91e354ad86c171e01c47f9c2f3ef5cf9f.tar.gz
dexon-19efebe91e354ad86c171e01c47f9c2f3ef5cf9f.tar.zst
dexon-19efebe91e354ad86c171e01c47f9c2f3ef5cf9f.zip
Updated tests and fixed suicide
Diffstat (limited to 'vm/vm.go')
-rw-r--r--vm/vm.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/vm/vm.go b/vm/vm.go
index 890a7dd2c..3647d7a5e 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -736,6 +736,7 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
self.Printf(" => (%x) %v", receiver.Address()[:4], balance)
receiver.AddBalance(balance)
+
statedb.Delete(context.Address())
fallthrough
@@ -905,6 +906,10 @@ func (self *Vm) calculateGasAndSize(context *Context, caller ContextRef, op OpCo
g = GasStorageMod
}
gas.Set(g)
+ case SUICIDE:
+ if !statedb.IsDeleted(context.Address()) {
+ statedb.Refund(self.env.Origin(), RefundSuicide)
+ }
case MLOAD:
newMemSize = calcMemSize(stack.Peek(), u256(32))
case MSTORE8: