@@ -72,7 +72,10 @@ func (p *statePrefetcher) Prefetch(block *types.Block, statedb *state.StateDB, c
72
72
return // Also invalid block, bail out
73
73
}
74
74
statedb .SetTxContext (tx .Hash (), i )
75
- if err := precacheTransaction (msg , p .config , gaspool , quotaPool , statedb , header , cvm ); err != nil {
75
+
76
+ // We attempt to apply a transaction. The goal is not to execute
77
+ // the transaction successfully, rather to warm up touched data slots.
78
+ if _ , err := ApplyMessage (cvm , msg , gaspool , quotaPool ); err != nil {
76
79
return // Ugh, something went horribly wrong, bail out
77
80
}
78
81
// If we're pre-byzantium, pre-load trie nodes for the intermediate root
@@ -85,13 +88,3 @@ func (p *statePrefetcher) Prefetch(block *types.Block, statedb *state.StateDB, c
85
88
statedb .IntermediateRoot (true )
86
89
}
87
90
}
88
-
89
- // precacheTransaction attempts to apply a transaction to the given state database
90
- // and uses the input parameters for its environment. The goal is not to execute
91
- // the transaction successfully, rather to warm up touched data slots.
92
- func precacheTransaction (msg * Message , config * params.ChainConfig , gaspool * GasPool , quotaPool * QuotaPool , statedb * state.StateDB , header * types.Header , cvm * vm.CVM ) error {
93
- cvm .Reset (NewCVMTxContext (msg ), statedb )
94
-
95
- _ , err := ApplyMessage (cvm , msg , gaspool , quotaPool )
96
- return err
97
- }
0 commit comments