Updated tests and fixed suicide

This commit is contained in:
obscuren
2015-03-09 11:28:35 +01:00
parent 93cdffca3a
commit 19efebe91e
4 changed files with 23 additions and 1 deletions

View File

@@ -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
//