mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Update tx_pool.go
This commit is contained in:
parent
8deba6f99a
commit
8ee274962b
1 changed files with 7 additions and 7 deletions
|
|
@ -110,7 +110,7 @@ var (
|
||||||
type TxStatus uint
|
type TxStatus uint
|
||||||
|
|
||||||
const (
|
const (
|
||||||
TxStatusUnknown TxStatus = iota
|
TxStatusUnknown TxStatus = iota
|
||||||
TxStatusQueued
|
TxStatusQueued
|
||||||
TxStatusPending
|
TxStatusPending
|
||||||
TxStatusIncluded
|
TxStatusIncluded
|
||||||
|
|
@ -327,13 +327,13 @@ func (pool *TxPool) loop() {
|
||||||
pool.requestReset(head.Header(), ev.Block.Header())
|
pool.requestReset(head.Header(), ev.Block.Header())
|
||||||
head = ev.Block
|
head = ev.Block
|
||||||
}
|
}
|
||||||
|
|
||||||
// Be unsubscribed due to system stopped
|
// System shutdown.
|
||||||
case <-pool.chainHeadSub.Err():
|
case <-pool.chainHeadSub.Err():
|
||||||
close(pool.reorgShutdownCh)
|
close(pool.reorgShutdownCh)
|
||||||
return
|
return
|
||||||
|
|
||||||
// Handle stats reporting ticks
|
// Handle stats reporting ticks
|
||||||
case <-report.C:
|
case <-report.C:
|
||||||
pool.mu.RLock()
|
pool.mu.RLock()
|
||||||
pending, queued := pool.stats()
|
pending, queued := pool.stats()
|
||||||
|
|
@ -345,7 +345,7 @@ func (pool *TxPool) loop() {
|
||||||
prevPending, prevQueued, prevStales = pending, queued, stales
|
prevPending, prevQueued, prevStales = pending, queued, stales
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle inactive account transaction eviction
|
// Handle inactive account transaction eviction
|
||||||
case <-evict.C:
|
case <-evict.C:
|
||||||
pool.mu.Lock()
|
pool.mu.Lock()
|
||||||
for addr := range pool.queue {
|
for addr := range pool.queue {
|
||||||
|
|
@ -362,7 +362,7 @@ func (pool *TxPool) loop() {
|
||||||
}
|
}
|
||||||
pool.mu.Unlock()
|
pool.mu.Unlock()
|
||||||
|
|
||||||
// Handle local transaction journal rotation
|
// Handle local transaction journal rotation
|
||||||
case <-journal.C:
|
case <-journal.C:
|
||||||
if pool.journal != nil {
|
if pool.journal != nil {
|
||||||
pool.mu.Lock()
|
pool.mu.Lock()
|
||||||
|
|
@ -526,7 +526,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
|
||||||
}
|
}
|
||||||
// Drop non-local transactions under our own minimal accepted gas price
|
// 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
|
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 || tx.GasPrice().Cmp(big.NewInt(0)) < 1 {
|
if !local && pool.gasPrice.Cmp(tx.GasPrice()) > 0 {
|
||||||
return ErrUnderpriced
|
return ErrUnderpriced
|
||||||
}
|
}
|
||||||
// Ensure the transaction adheres to nonce ordering
|
// Ensure the transaction adheres to nonce ordering
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue