aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm')
-rw-r--r--core/vm/environment.go7
-rw-r--r--core/vm/instructions.go2
-rw-r--r--core/vm/jit.go2
-rw-r--r--core/vm/vm.go2
4 files changed, 8 insertions, 5 deletions
diff --git a/core/vm/environment.go b/core/vm/environment.go
index 1038e69d5..a4b2ac196 100644
--- a/core/vm/environment.go
+++ b/core/vm/environment.go
@@ -105,9 +105,12 @@ type Database interface {
GetState(common.Address, common.Hash) common.Hash
SetState(common.Address, common.Hash, common.Hash)
- Delete(common.Address) bool
+ Suicide(common.Address) bool
+ HasSuicided(common.Address) bool
+
+ // Exist reports whether the given account exists in state.
+ // Notably this should also return true for suicided accounts.
Exist(common.Address) bool
- IsDeleted(common.Address) bool
}
// Account represents a contract or basic ethereum account.
diff --git a/core/vm/instructions.go b/core/vm/instructions.go
index 4f0f6a27a..1585ce6d5 100644
--- a/core/vm/instructions.go
+++ b/core/vm/instructions.go
@@ -614,7 +614,7 @@ func opSuicide(instr instruction, pc *uint64, env Environment, contract *Contrac
balance := env.Db().GetBalance(contract.Address())
env.Db().AddBalance(common.BigToAddress(stack.pop()), balance)
- env.Db().Delete(contract.Address())
+ env.Db().Suicide(contract.Address())
}
// following functions are used by the instruction jump table
diff --git a/core/vm/jit.go b/core/vm/jit.go
index f56d7c1af..7e16301bf 100644
--- a/core/vm/jit.go
+++ b/core/vm/jit.go
@@ -425,7 +425,7 @@ func jitCalculateGasAndSize(env Environment, contract *Contract, instr instructi
}
gas.Set(g)
case SUICIDE:
- if !statedb.IsDeleted(contract.Address()) {
+ if !statedb.HasSuicided(contract.Address()) {
statedb.AddRefund(params.SuicideRefundGas)
}
case MLOAD:
diff --git a/core/vm/vm.go b/core/vm/vm.go
index 05bd2710a..376e53543 100644
--- a/core/vm/vm.go
+++ b/core/vm/vm.go
@@ -311,7 +311,7 @@ func calculateGasAndSize(env Environment, contract *Contract, caller ContractRef
}
gas.Set(g)
case SUICIDE:
- if !statedb.IsDeleted(contract.Address()) {
+ if !statedb.HasSuicided(contract.Address()) {
statedb.AddRefund(params.SuicideRefundGas)
}
case MLOAD: