aboutsummaryrefslogtreecommitdiffstats
path: root/miner/worker.go
diff options
context:
space:
mode:
Diffstat (limited to 'miner/worker.go')
-rw-r--r--miner/worker.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/miner/worker.go b/miner/worker.go
index ca68da6e9..5348cb3f1 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -127,6 +127,9 @@ type worker struct {
eth Backend
chain *core.BlockChain
+ gasFloor uint64
+ gasCeil uint64
+
// Subscriptions
mux *event.TypeMux
txsCh chan core.NewTxsEvent
@@ -171,13 +174,15 @@ type worker struct {
resubmitHook func(time.Duration, time.Duration) // Method to call upon updating resubmitting interval.
}
-func newWorker(config *params.ChainConfig, engine consensus.Engine, eth Backend, mux *event.TypeMux, recommit time.Duration) *worker {
+func newWorker(config *params.ChainConfig, engine consensus.Engine, eth Backend, mux *event.TypeMux, recommit time.Duration, gasFloor, gasCeil uint64) *worker {
worker := &worker{
config: config,
engine: engine,
eth: eth,
mux: mux,
chain: eth.BlockChain(),
+ gasFloor: gasFloor,
+ gasCeil: gasCeil,
possibleUncles: make(map[common.Hash]*types.Block),
unconfirmed: newUnconfirmedBlocks(eth.BlockChain(), miningLogAtDepth),
pendingTasks: make(map[common.Hash]*task),
@@ -807,7 +812,7 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool) {
header := &types.Header{
ParentHash: parent.Hash(),
Number: num.Add(num, common.Big1),
- GasLimit: core.CalcGasLimit(parent),
+ GasLimit: core.CalcGasLimit(parent, w.gasFloor, w.gasCeil),
Extra: w.extra,
Time: big.NewInt(tstamp),
}