core/state: rename Delete/IsDeleted to Suicide/HasSuicided

The delete/remove naming has caused endless confusion in the past.
This commit is contained in:
Felix Lange
2016-10-06 15:32:17 +02:00
parent 1f1ea18b54
commit 90fce8bfa6
9 changed files with 35 additions and 32 deletions
+5 -2
View File
@@ -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.
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -303,7 +303,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: