diff options
Diffstat (limited to 'core/dao.go')
-rw-r--r-- | core/dao.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/dao.go b/core/dao.go index a7f544c3d..7e376e68a 100644 --- a/core/dao.go +++ b/core/dao.go @@ -62,13 +62,13 @@ func ValidateDAOHeaderExtraData(config *params.ChainConfig, header *types.Header // contract. func ApplyDAOHardFork(statedb *state.StateDB) { // Retrieve the contract to refund balances into - refund := statedb.GetOrNewStateObject(params.DAORefundContract) + if !statedb.Exist(params.DAORefundContract) { + statedb.CreateAccount(params.DAORefundContract) + } // Move every DAO account and extra-balance account funds into the refund contract for _, addr := range params.DAODrainList { - if account := statedb.GetStateObject(addr); account != nil { - refund.AddBalance(account.Balance()) - account.SetBalance(new(big.Int)) - } + statedb.AddBalance(params.DAORefundContract, statedb.GetBalance(addr)) + statedb.SetBalance(addr, new(big.Int)) } } |