minor fix

This commit is contained in:
jmlee 2019-07-18 16:37:02 +09:00
parent 45aeb70774
commit aaf3bb5e9e

View file

@ -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()
} }