17
17
package core
18
18
19
19
import (
20
- "errors"
21
20
"math/big"
22
21
23
- "github.com/ethereum/go-ethereum/common"
24
22
"github.com/ethereum/go-ethereum/core/state"
25
23
"github.com/ethereum/go-ethereum/core/types"
26
24
"github.com/ethereum/go-ethereum/core/vm"
@@ -30,15 +28,8 @@ import (
30
28
)
31
29
32
30
var (
33
- big8 = big .NewInt (8 )
34
- big32 = big .NewInt (32 )
35
- illegalCodeHashErr = errors .New ("core: Illegal code-hash found during execution" )
36
- // XXX remove me
37
- daoHash = common .HexToHash ("7278d050619a624f84f51987149ddb439cdaadfba5966f7cfaea7ad44340a4ba" )
38
- whitelist = map [common.Address ]bool {
39
- common .HexToAddress ("Da4a4626d3E16e094De3225A751aAb7128e96526" ): true , // multisig
40
- common .HexToAddress ("2ba9D006C1D72E67A70b5526Fc6b4b0C0fd6D334" ): true , // attack contract
41
- }
31
+ big8 = big .NewInt (8 )
32
+ big32 = big .NewInt (32 )
42
33
)
43
34
44
35
// StateProcessor is a basic Processor, which takes care of transitioning
@@ -95,20 +86,11 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
95
86
// ApplyTransactions returns the generated receipts and vm logs during the
96
87
// execution of the state transition phase.
97
88
func ApplyTransaction (config * ChainConfig , bc * BlockChain , gp * GasPool , statedb * state.StateDB , header * types.Header , tx * types.Transaction , usedGas * big.Int , cfg vm.Config ) (* types.Receipt , vm.Logs , * big.Int , error ) {
98
- env := NewEnv (statedb , config , bc , tx , header , cfg )
99
- _ , gas , err := ApplyMessage (env , tx , gp )
89
+ _ , gas , err := ApplyMessage (NewEnv (statedb , config , bc , tx , header , cfg ), tx , gp )
100
90
if err != nil {
101
91
return nil , nil , nil , err
102
92
}
103
93
104
- for _ , codeHash := range env .CodeHashes {
105
- _ , illegalHash := IllegalCodeHashes [codeHash ]
106
- to := tx .To ()
107
- if illegalHash && to != nil && ! whitelist [* to ] {
108
- return nil , nil , nil , illegalCodeHashErr
109
- }
110
- }
111
-
112
94
// Update the state with pending changes
113
95
usedGas .Add (usedGas , gas )
114
96
receipt := types .NewReceipt (statedb .IntermediateRoot ().Bytes (), usedGas )
0 commit comments