@@ -275,10 +275,10 @@ func (self *StateDB) GetState(a common.Address, b common.Hash) common.Hash {
275
275
return common.Hash {}
276
276
}
277
277
278
- func (self * StateDB ) IsDeleted (addr common.Address ) bool {
278
+ func (self * StateDB ) HasSuicided (addr common.Address ) bool {
279
279
stateObject := self .GetStateObject (addr )
280
280
if stateObject != nil {
281
- return stateObject .remove
281
+ return stateObject .suicided
282
282
}
283
283
return false
284
284
}
@@ -322,22 +322,22 @@ func (self *StateDB) SetState(addr common.Address, key common.Hash, value common
322
322
}
323
323
}
324
324
325
- // Delete marks the given account as suicided.
325
+ // Suicide marks the given account as suicided.
326
326
// This clears the account balance.
327
327
//
328
328
// The account's state object is still available until the state is committed,
329
- // GetStateObject will return a non-nil account after Delete .
330
- func (self * StateDB ) Delete (addr common.Address ) bool {
329
+ // GetStateObject will return a non-nil account after Suicide .
330
+ func (self * StateDB ) Suicide (addr common.Address ) bool {
331
331
stateObject := self .GetStateObject (addr )
332
332
if stateObject == nil {
333
333
return false
334
334
}
335
- self .journal = append (self .journal , deleteAccountChange {
335
+ self .journal = append (self .journal , suicideChange {
336
336
account : & addr ,
337
- prev : stateObject .remove ,
337
+ prev : stateObject .suicided ,
338
338
prevbalance : new (big.Int ).Set (stateObject .Balance ()),
339
339
})
340
- stateObject .markForDeletion ()
340
+ stateObject .markSuicided ()
341
341
stateObject .data .Balance = new (big.Int )
342
342
return true
343
343
}
@@ -516,7 +516,7 @@ func (self *StateDB) GetRefund() *big.Int {
516
516
func (s * StateDB ) IntermediateRoot () common.Hash {
517
517
for addr , _ := range s .stateObjectsDirty {
518
518
stateObject := s .stateObjects [addr ]
519
- if stateObject .remove {
519
+ if stateObject .suicided {
520
520
s .deleteStateObject (stateObject )
521
521
} else {
522
522
stateObject .updateRoot (s .db )
@@ -542,7 +542,7 @@ func (s *StateDB) DeleteSuicides() {
542
542
543
543
// If the object has been removed by a suicide
544
544
// flag the object as deleted.
545
- if stateObject .remove {
545
+ if stateObject .suicided {
546
546
stateObject .deleted = true
547
547
}
548
548
delete (s .stateObjectsDirty , addr )
@@ -575,7 +575,7 @@ func (s *StateDB) commit(dbw trie.DatabaseWriter) (root common.Hash, err error)
575
575
576
576
// Commit objects to the trie.
577
577
for addr , stateObject := range s .stateObjects {
578
- if stateObject .remove {
578
+ if stateObject .suicided {
579
579
// If the object has been removed, don't bother syncing it
580
580
// and just mark it for deletion in the trie.
581
581
s .deleteStateObject (stateObject )
0 commit comments