aboutsummaryrefslogtreecommitdiffstats
path: root/vm
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
parent93cdffca3ad23eedae6f0591e1357c2429b31811 (diff)
downloadgo-tangerine-19efebe91e354ad86c171e01c47f9c2f3ef5cf9f.tar
go-tangerine-19efebe91e354ad86c171e01c47f9c2f3ef5cf9f.tar.gz
go-tangerine-19efebe91e354ad86c171e01c47f9c2f3ef5cf9f.tar.bz2
go-tangerine-19efebe91e354ad86c171e01c47f9c2f3ef5cf9f.tar.lz
go-tangerine-19efebe91e354ad86c171e01c47f9c2f3ef5cf9f.tar.xz
go-tangerine-19efebe91e354ad86c171e01c47f9c2f3ef5cf9f.tar.zst
go-tangerine-19efebe91e354ad86c171e01c47f9c2f3ef5cf9f.zip
Updated tests and fixed suicide
Diffstat (limited to 'vm')
-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: