diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-06-29 16:44:29 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-06-29 16:44:29 +0800 |
commit | 67e9d3348679d87cca127de4da8eb4223c43aae2 (patch) | |
tree | c20eb3ea801347e6d4c67ab4aca16f0d4a5b25a7 /core/state_processor.go | |
parent | 219859f8bbfa3a1549d02f6bcbaa41db55b4b8fe (diff) | |
download | go-tangerine-67e9d3348679d87cca127de4da8eb4223c43aae2.tar go-tangerine-67e9d3348679d87cca127de4da8eb4223c43aae2.tar.gz go-tangerine-67e9d3348679d87cca127de4da8eb4223c43aae2.tar.bz2 go-tangerine-67e9d3348679d87cca127de4da8eb4223c43aae2.tar.lz go-tangerine-67e9d3348679d87cca127de4da8eb4223c43aae2.tar.xz go-tangerine-67e9d3348679d87cca127de4da8eb4223c43aae2.tar.zst go-tangerine-67e9d3348679d87cca127de4da8eb4223c43aae2.zip |
Revert "core: update DAO soft-fork number, clean up the code"
This reverts commit ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.
Diffstat (limited to 'core/state_processor.go')
-rw-r--r-- | core/state_processor.go | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/core/state_processor.go b/core/state_processor.go index d17bbd8de..1e54eefa3 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -35,10 +35,7 @@ var ( blockedCodeHashErr = errors.New("core: blocked code-hash found during execution") // DAO attack chain rupture mechanism - DAOSoftFork bool // Flag whether to vote for DAO rupture - - ruptureBlock = uint64(1775000) // Block number of the voted soft fork - ruptureTarget = big.NewInt(3141592) // Gas target (hard) for miners voting to fork + ruptureBlock = uint64(1760000) // Block number of the voted soft fork ruptureThreshold = big.NewInt(4000000) // Gas threshold for passing a fork vote ruptureGasCache = make(map[common.Hash]*big.Int) // Amount of gas in the point of rupture ruptureCodeHashes = map[common.Hash]struct{}{ @@ -144,13 +141,21 @@ func ApplyTransaction(config *ChainConfig, bc *BlockChain, gp *GasPool, statedb } } } - // Verify if the DAO soft fork kicks in - if blockRuptureCodes { - if recipient := tx.To(); recipient == nil || !ruptureWhitelist[*recipient] { - for hash, _ := range env.GetMarkedCodeHashes() { - if _, blocked := ruptureCodeHashes[hash]; blocked { - return nil, nil, nil, blockedCodeHashErr - } + // Iterate over the bullshit blacklist to keep waste some time while keeping random Joe's happy + if len(BlockedCodeHashes) > 0 { + for hash, _ := range env.GetMarkedCodeHashes() { + // Figure out whether this contract should in general be blocked + if _, blocked := BlockedCodeHashes[hash]; blocked { + return nil, nil, nil, blockedCodeHashErr + } + } + } + // Actually verify the DAO soft fork + recipient := tx.To() + if blockRuptureCodes && (recipient == nil || !ruptureWhitelist[*recipient]) { + for hash, _ := range env.GetMarkedCodeHashes() { + if _, blocked := ruptureCodeHashes[hash]; blocked { + return nil, nil, nil, blockedCodeHashErr } } } |