aboutsummaryrefslogtreecommitdiffstats
path: root/core/dao.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2017-02-23 06:29:59 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-02-23 06:29:59 +0800
commit024d41d0c2660d8f1dfbeb14921c7109e30493a2 (patch)
treea2b4ed630b84084c7f439d1539ed0551ec729cbd /core/dao.go
parent46ec4357e73dd0c43951d11638d9aed94f8ffd29 (diff)
downloadgo-tangerine-024d41d0c2660d8f1dfbeb14921c7109e30493a2.tar
go-tangerine-024d41d0c2660d8f1dfbeb14921c7109e30493a2.tar.gz
go-tangerine-024d41d0c2660d8f1dfbeb14921c7109e30493a2.tar.bz2
go-tangerine-024d41d0c2660d8f1dfbeb14921c7109e30493a2.tar.lz
go-tangerine-024d41d0c2660d8f1dfbeb14921c7109e30493a2.tar.xz
go-tangerine-024d41d0c2660d8f1dfbeb14921c7109e30493a2.tar.zst
go-tangerine-024d41d0c2660d8f1dfbeb14921c7109e30493a2.zip
core, core/state, core/vm: remove exported account getters (#3618)
Removed exported statedb object accessors, reducing the chance for nasty bugs to creep in. It's also ugly and unnecessary to have these methods.
Diffstat (limited to 'core/dao.go')
-rw-r--r--core/dao.go10
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))
}
}