aboutsummaryrefslogtreecommitdiffstats
path: root/state
diff options
context:
space:
mode:
Diffstat (limited to 'state')
-rw-r--r--state/state_object.go2
-rw-r--r--state/statedb.go9
2 files changed, 10 insertions, 1 deletions
diff --git a/state/state_object.go b/state/state_object.go
index 51ec95efa..ccbfea391 100644
--- a/state/state_object.go
+++ b/state/state_object.go
@@ -111,7 +111,7 @@ func NewStateObjectFromBytes(address, data []byte, db ethutil.Database) *StateOb
func (self *StateObject) MarkForDeletion() {
self.remove = true
self.dirty = true
- statelogger.DebugDetailf("%x: #%d %v (deletion)\n", self.Address(), self.nonce, self.balance)
+ statelogger.Debugf("%x: #%d %v X\n", self.Address(), self.nonce, self.balance)
}
func (c *StateObject) getAddr(addr []byte) *ethutil.Value {
diff --git a/state/statedb.go b/state/statedb.go
index 1231b4c1d..0a4156461 100644
--- a/state/statedb.go
+++ b/state/statedb.go
@@ -121,6 +121,7 @@ func (self *StateDB) Delete(addr []byte) bool {
stateObject := self.GetOrNewStateObject(addr)
if stateObject != nil {
stateObject.MarkForDeletion()
+ stateObject.balance = new(big.Int)
return true
}
@@ -128,6 +129,14 @@ func (self *StateDB) Delete(addr []byte) bool {
return false
}
+func (self *StateDB) IsDeleted(addr []byte) bool {
+ stateObject := self.GetStateObject(addr)
+ if stateObject != nil {
+ return stateObject.remove
+ }
+ return false
+}
+
//
// Setting, updating & deleting state object methods
//