eth, internal: move package dao to internal, keep The DAO state

This commit is contained in:
Gustav Simonsson 2016-06-30 12:56:53 +02:00
parent 23dea66549
commit b467e7ca66
2 changed files with 3 additions and 8 deletions

View file

@ -29,7 +29,7 @@ import (
"math/big" "math/big"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/dao" "github.com/ethereum/go-ethereum/internal/dao"
"github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog" "github.com/ethereum/go-ethereum/logger/glog"
) )
@ -167,12 +167,6 @@ func applyHardFork(hfData *DAOHardForkData, eth *Ethereum) error {
return err return err
} }
// first, delete "The DAO" state object to wipe any state
statedb.Delete(theDAOAddr)
// next, re-create account
statedb.CreateAccount(theDAOAddr)
// move all ether from all the children of the "The DAO" // move all ether from all the children of the "The DAO"
// as well as their extraBalance accounts back to "The DAO" account // as well as their extraBalance accounts back to "The DAO" account
theDAOAcc := statedb.GetAccount(theDAOAddr) theDAOAcc := statedb.GetAccount(theDAOAddr)
@ -195,7 +189,8 @@ func applyHardFork(hfData *DAOHardForkData, eth *Ethereum) error {
// set new code of "The DAO" account (this also sets codeHash, see core/state/state_object.go) // set new code of "The DAO" account (this also sets codeHash, see core/state/state_object.go)
theDAOAcc.SetCode(hfData.TheDAOReplacementCode) theDAOAcc.SetCode(hfData.TheDAOReplacementCode)
// TODO: set state or run constructor of new contract code // TODO: at this point, the account state (variables) have not changed;
// verify if they should be modified or can be kept unmodified.
glog.V(logger.Info).Infof("wei in re-created DAO: %v", theDAOAcc.Balance()) glog.V(logger.Info).Infof("wei in re-created DAO: %v", theDAOAcc.Balance())
return nil return nil