From aaf3bb5e9e8e2c742bc7063f93118e3bb0d964ca Mon Sep 17 00:00:00 2001 From: jmlee Date: Thu, 18 Jul 2019 16:37:02 +0900 Subject: [PATCH] minor fix --- core/evm.go | 6 ++++++ 1 file changed, 6 insertions(+) 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() + }