diff --git a/core/evm.go b/core/evm.go index 1fd4849622..0c16e811ee 100644 --- a/core/evm.go +++ b/core/evm.go @@ -99,7 +99,13 @@ func Transfer(db vm.StateDB, sender, recipient common.Address, amount *big.Int) // Restore restores the inactive account (jmlee) func Restore(db vm.StateDB, inactiveAddr common.Address, amount *big.Int) { + // set account balance with 0 (delete cached balance) bal := db.GetBalance(inactiveAddr) db.SubBalance(inactiveAddr, bal) + + // restore inactive account with latest state db.AddBalance(inactiveAddr, amount) + + // todo: set nonce properly -> db.SetNonce() + }