|
|
@ -252,7 +252,7 @@ func (self *worker) update() { |
|
|
|
txs := map[common.Address]types.Transactions{acc: {ev.Tx}} |
|
|
|
txs := map[common.Address]types.Transactions{acc: {ev.Tx}} |
|
|
|
txset := types.NewTransactionsByPriceAndNonce(txs) |
|
|
|
txset := types.NewTransactionsByPriceAndNonce(txs) |
|
|
|
|
|
|
|
|
|
|
|
self.current.commitTransactions(self.mux, txset, self.gasPrice, self.chain) |
|
|
|
self.current.commitTransactions(self.mux, txset, self.gasPrice, self.chain, self.coinbase) |
|
|
|
self.currentMu.Unlock() |
|
|
|
self.currentMu.Unlock() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -460,7 +460,7 @@ func (self *worker) commitNewWork() { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
txs := types.NewTransactionsByPriceAndNonce(pending) |
|
|
|
txs := types.NewTransactionsByPriceAndNonce(pending) |
|
|
|
work.commitTransactions(self.mux, txs, self.gasPrice, self.chain) |
|
|
|
work.commitTransactions(self.mux, txs, self.gasPrice, self.chain, self.coinbase) |
|
|
|
|
|
|
|
|
|
|
|
self.eth.TxPool().RemoveBatch(work.lowGasTxs) |
|
|
|
self.eth.TxPool().RemoveBatch(work.lowGasTxs) |
|
|
|
self.eth.TxPool().RemoveBatch(work.failedTxs) |
|
|
|
self.eth.TxPool().RemoveBatch(work.failedTxs) |
|
|
@ -515,7 +515,7 @@ func (self *worker) commitUncle(work *Work, uncle *types.Header) error { |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (env *Work) commitTransactions(mux *event.TypeMux, txs *types.TransactionsByPriceAndNonce, gasPrice *big.Int, bc *core.BlockChain) { |
|
|
|
func (env *Work) commitTransactions(mux *event.TypeMux, txs *types.TransactionsByPriceAndNonce, gasPrice *big.Int, bc *core.BlockChain, coinbase common.Address) { |
|
|
|
gp := new(core.GasPool).AddGas(env.header.GasLimit) |
|
|
|
gp := new(core.GasPool).AddGas(env.header.GasLimit) |
|
|
|
|
|
|
|
|
|
|
|
var coalescedLogs []*types.Log |
|
|
|
var coalescedLogs []*types.Log |
|
|
@ -553,7 +553,7 @@ func (env *Work) commitTransactions(mux *event.TypeMux, txs *types.TransactionsB |
|
|
|
// Start executing the transaction
|
|
|
|
// Start executing the transaction
|
|
|
|
env.state.StartRecord(tx.Hash(), common.Hash{}, env.tcount) |
|
|
|
env.state.StartRecord(tx.Hash(), common.Hash{}, env.tcount) |
|
|
|
|
|
|
|
|
|
|
|
err, logs := env.commitTransaction(tx, bc, gp) |
|
|
|
err, logs := env.commitTransaction(tx, bc, coinbase, gp) |
|
|
|
switch err { |
|
|
|
switch err { |
|
|
|
case core.ErrGasLimitReached: |
|
|
|
case core.ErrGasLimitReached: |
|
|
|
// Pop the current out-of-gas transaction without shifting in the next from the account
|
|
|
|
// Pop the current out-of-gas transaction without shifting in the next from the account
|
|
|
@ -594,10 +594,10 @@ func (env *Work) commitTransactions(mux *event.TypeMux, txs *types.TransactionsB |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (env *Work) commitTransaction(tx *types.Transaction, bc *core.BlockChain, gp *core.GasPool) (error, []*types.Log) { |
|
|
|
func (env *Work) commitTransaction(tx *types.Transaction, bc *core.BlockChain, coinbase common.Address, gp *core.GasPool) (error, []*types.Log) { |
|
|
|
snap := env.state.Snapshot() |
|
|
|
snap := env.state.Snapshot() |
|
|
|
|
|
|
|
|
|
|
|
receipt, _, err := core.ApplyTransaction(env.config, bc, gp, env.state, env.header, tx, env.header.GasUsed, vm.Config{}) |
|
|
|
receipt, _, err := core.ApplyTransaction(env.config, bc, &coinbase, gp, env.state, env.header, tx, env.header.GasUsed, vm.Config{}) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
env.state.RevertToSnapshot(snap) |
|
|
|
env.state.RevertToSnapshot(snap) |
|
|
|
return err, nil |
|
|
|
return err, nil |
|
|
|