mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
minor fix
This commit is contained in:
parent
45aeb70774
commit
aaf3bb5e9e
1 changed files with 6 additions and 0 deletions
|
|
@ -99,7 +99,13 @@ func Transfer(db vm.StateDB, sender, recipient common.Address, amount *big.Int)
|
||||||
|
|
||||||
// Restore restores the inactive account (jmlee)
|
// Restore restores the inactive account (jmlee)
|
||||||
func Restore(db vm.StateDB, inactiveAddr common.Address, amount *big.Int) {
|
func Restore(db vm.StateDB, inactiveAddr common.Address, amount *big.Int) {
|
||||||
|
// set account balance with 0 (delete cached balance)
|
||||||
bal := db.GetBalance(inactiveAddr)
|
bal := db.GetBalance(inactiveAddr)
|
||||||
db.SubBalance(inactiveAddr, bal)
|
db.SubBalance(inactiveAddr, bal)
|
||||||
|
|
||||||
|
// restore inactive account with latest state
|
||||||
db.AddBalance(inactiveAddr, amount)
|
db.AddBalance(inactiveAddr, amount)
|
||||||
|
|
||||||
|
// todo: set nonce properly -> db.SetNonce()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue