Skip to content

Commit

Permalink
miner: sets baseFee in pending block
Browse files Browse the repository at this point in the history
  • Loading branch information
sadoci authored and MetadiumRelease committed Sep 22, 2022
1 parent d5fdd66 commit 548c814
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions miner/worker.go
Expand Up @@ -1433,6 +1433,13 @@ func (w *worker) refreshPending(locked bool) {
Fees: big.NewInt(0),
}
header.Coinbase = w.coinbase
// Set baseFee and GasLimit if we are on an EIP-1559 chain
if w.chainConfig.IsLondon(header.Number) {
header.BaseFee = misc.CalcBaseFee(w.chainConfig, parent.Header())
if !w.chainConfig.IsLondon(parent.Number()) {
header.GasLimit = parent.GasLimit()
}
}
if err := w.engine.Prepare(w.chain, header); err != nil {
log.Error("Failed to prepare header for mining", "err", err)
return
Expand Down

0 comments on commit 548c814

Please sign in to comment.