aboutsummaryrefslogtreecommitdiffstats
path: root/miner/worker.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-04-12 21:38:31 +0800
committerGitHub <noreply@github.com>2017-04-12 21:38:31 +0800
commita7b9e484d05ceb0afce4ba5dbc62b8f262c2e354 (patch)
tree35ab50c0e276beb15e6beac2eaa846f6b737f64c /miner/worker.go
parent6b7ae4e751dbaee0f31032f045fd35b0c1079388 (diff)
downloadgo-tangerine-a7b9e484d05ceb0afce4ba5dbc62b8f262c2e354.tar.gz
go-tangerine-a7b9e484d05ceb0afce4ba5dbc62b8f262c2e354.tar.zst
go-tangerine-a7b9e484d05ceb0afce4ba5dbc62b8f262c2e354.zip
consensus, core, ethstats: use engine specific block beneficiary (#14318)
* consensus, core, ethstats: use engine specific block beneficiary * core, eth, les, miner: use explicit beneficiary during mining
Diffstat (limited to 'miner/worker.go')
-rw-r--r--miner/worker.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/miner/worker.go b/miner/worker.go
index 8a67b12a6..01241b3f3 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -252,7 +252,7 @@ func (self *worker) update() {
txs := map[common.Address]types.Transactions{acc: {ev.Tx}}
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()
}
}
@@ -460,7 +460,7 @@ func (self *worker) commitNewWork() {
return
}
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.failedTxs)
@@ -515,7 +515,7 @@ func (self *worker) commitUncle(work *Work, uncle *types.Header) error {
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)
var coalescedLogs []*types.Log
@@ -553,7 +553,7 @@ func (env *Work) commitTransactions(mux *event.TypeMux, txs *types.TransactionsB
// Start executing the transaction
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 {
case core.ErrGasLimitReached:
// 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()
- 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 {
env.state.RevertToSnapshot(snap)
return err, nil