cmd, core, eth, miner, params: configurable gas floor and ceil
This commit is contained in:
@ -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),
|
||||
}
|
||||
|
Reference in New Issue
Block a user