[release/1.4.10] cmd, core, eth, miner, params, tests: finalize the DAO fork

(cherry picked from commit 2c2e389b77)
This commit is contained in:
Péter Szilágyi
2016-07-14 11:22:58 +03:00
parent b8c0883770
commit 1b2941cd56
12 changed files with 7520 additions and 415 deletions

View File

@ -25,7 +25,6 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/params"
)
var (
@ -134,19 +133,3 @@ func AccumulateRewards(statedb *state.StateDB, header *types.Header, uncles []*t
}
statedb.AddBalance(header.Coinbase, reward)
}
// ApplyDAOHardFork modifies the state database according to the DAO hard-fork
// rules, transferring all balances of a set of DAO accounts to a single refund
// contract.
func ApplyDAOHardFork(statedb *state.StateDB) {
// Retrieve the contract to refund balances into
refund := statedb.GetOrNewStateObject(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))
}
}
}