miner: avoid transaction processing when pending block is already full

This commit is contained in:
Martin Holst Swende 2019-06-19 10:34:00 +02:00
parent 6fffb61bc1
commit dbdd485a3a
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -453,6 +453,10 @@ func (w *worker) mainLoop() {
// already included in the current mining block. These transactions will
// be automatically eliminated.
if !w.isRunning() && w.current != nil {
// If block is already full, abort
if gp := w.current.gasPool; gp != nil && gp.Gas() < params.TxGas {
continue
}
w.mu.RLock()
coinbase := w.coinbase
w.mu.RUnlock()