@@ -84,7 +84,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
8484 return nil , nil , 0 , err
8585 }
8686 statedb .Prepare (tx .Hash (), i )
87- receipt , _ , err := applyTransaction (msg , p .config , nil , gp , qp , statedb , header , blockNumber , blockHash , tx , usedGas , vmenv )
87+ receipt , _ , err := applyTransaction (msg , p .config , gp , qp , statedb , header , blockNumber , blockHash , tx , usedGas , vmenv )
8888 if err != nil {
8989 return nil , nil , 0 , fmt .Errorf ("could not apply tx %d [%v]: %w" , i , tx .Hash ().Hex (), err )
9090 }
@@ -106,7 +106,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
106106// and uses the input parameters for its environment. It returns the receipt
107107// for the transaction, gas used and an error if the transaction failed,
108108// indicating the block was invalid.
109- func applyTransaction (msg types.Message , config * params.ChainConfig , author * common. Address , gp * GasPool , qp * QuotaPool , statedb * state.StateDB , header * types.Header , blockNumber * big.Int , blockHash common.Hash , tx * types.Transaction , usedGas * uint64 , cvm * vm.CVM ) (* types.Receipt , uint64 , error ) {
109+ func applyTransaction (msg types.Message , config * params.ChainConfig , gp * GasPool , qp * QuotaPool , statedb * state.StateDB , header * types.Header , blockNumber * big.Int , blockHash common.Hash , tx * types.Transaction , usedGas * uint64 , cvm * vm.CVM ) (* types.Receipt , uint64 , error ) {
110110 // Create a new context to be used in the CVM environment
111111 txContext := NewCVMTxContext (msg )
112112 // Update the evm with the new transaction context.
@@ -146,7 +146,7 @@ func applyTransaction(msg types.Message, config *params.ChainConfig, author *com
146146 receipt .ContractAddress = crypto .CreateAddress (cvm .TxContext .Origin , tx .Nonce ())
147147 }
148148 // Set the receipt logs and create a bloom for filtering
149- receipt .Logs = statedb .GetLogs (tx .Hash (), blockHash )
149+ receipt .Logs = statedb .GetLogs (tx .Hash (), blockNumber . Uint64 (), blockHash )
150150 receipt .Bloom = types .CreateBloom (types.Receipts {receipt })
151151
152152 receipt .BlockHash = blockHash
@@ -169,5 +169,5 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo
169169 // Create a new context to be used in the CVM environment
170170 blockContext := NewCVMBlockContext (header , bc , author )
171171 vmenv := vm .NewCVM (blockContext , vm.TxContext {}, statedb , config , cfg )
172- return applyTransaction (msg , config , author , gp , qp , statedb , header , header .Number , header .Hash (), tx , usedGas , vmenv )
172+ return applyTransaction (msg , config , gp , qp , statedb , header , header .Number , header .Hash (), tx , usedGas , vmenv )
173173}
0 commit comments