CreateAccount explicitly creates a state object. If a state object with the address already exists the balance is carried over to the new account. CreateAccount is called during the EVM CREATE operation. The situation might arise that a contract does the following: 1. sends funds to sha(account ++
(addr common.Address)
| 424 | // |
| 425 | // Carrying over the balance ensures that Ether doesn't disappear. |
| 426 | func (self *StateDB) CreateAccount(addr common.Address) { |
| 427 | new, prev := self.createObject(addr) |
| 428 | if prev != nil { |
| 429 | new.setBalance(prev.data.Balance) |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | func (db *StateDB) ForEachStorage(addr common.Address, cb func(key, value common.Hash) bool) { |
| 434 | so := db.getStateObject(addr) |
nothing calls this directly
no test coverage detected