From 19efebe91e354ad86c171e01c47f9c2f3ef5cf9f Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 9 Mar 2015 11:28:35 +0100 Subject: Updated tests and fixed suicide --- vm/vm.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'vm') 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: -- cgit v1.2.3