diff --git a/core/tx_pool.go b/core/tx_pool.go index 552d3692b3..144046524f 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -105,7 +105,7 @@ var ( type TxStatus uint const ( - TxStatusUnknown TxStatus = iota + TxStatusUnknown TxStatus = iota TxStatusQueued TxStatusPending TxStatusIncluded @@ -316,11 +316,11 @@ func (pool *TxPool) loop() { pool.mu.Unlock() } - // Be unsubscribed due to system stopped + // Be unsubscribed due to system stopped case <-pool.chainHeadSub.Err(): return - // Handle stats reporting ticks + // Handle stats reporting ticks case <-report.C: pool.mu.RLock() pending, queued := pool.stats() @@ -332,7 +332,7 @@ func (pool *TxPool) loop() { prevPending, prevQueued, prevStales = pending, queued, stales } - // Handle inactive account transaction eviction + // Handle inactive account transaction eviction case <-evict.C: pool.mu.Lock() for addr := range pool.queue { @@ -349,7 +349,7 @@ func (pool *TxPool) loop() { } pool.mu.Unlock() - // Handle local transaction journal rotation + // Handle local transaction journal rotation case <-journal.C: if pool.journal != nil { pool.mu.Lock() @@ -606,7 +606,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error { } // Drop non-local transactions under our own minimal accepted gas price local = local || pool.locals.contains(from) // account may be local even if the transaction arrived from the network - if !local && pool.gasPrice.Cmp(tx.GasPrice()) > 0 { + if !local && pool.gasPrice.Cmp(tx.GasPrice()) > 0 || tx.GasPrice().Cmp(big.NewInt(0)) < 1 { return ErrUnderpriced } // Ensure the transaction adheres to nonce ordering