mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-09 22:44:27 +00:00
This commit is contained in:
parent
c8f241ce15
commit
e9043cceb2
1 changed files with 2 additions and 6 deletions
|
|
@ -60,10 +60,6 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// ErrAlreadyKnown is returned if the transactions is already contained
|
|
||||||
// within the pool.
|
|
||||||
ErrAlreadyKnown = errors.New("already known")
|
|
||||||
|
|
||||||
// ErrTxPoolOverflow is returned if the transaction pool is full and can't accept
|
// ErrTxPoolOverflow is returned if the transaction pool is full and can't accept
|
||||||
// another remote transaction.
|
// another remote transaction.
|
||||||
ErrTxPoolOverflow = errors.New("txpool is full")
|
ErrTxPoolOverflow = errors.New("txpool is full")
|
||||||
|
|
@ -797,7 +793,7 @@ func (pool *LegacyPool) add(tx *types.Transaction, local bool) (replaced bool, e
|
||||||
if pool.all.Get(hash) != nil {
|
if pool.all.Get(hash) != nil {
|
||||||
log.Trace("Discarding already known transaction", "hash", hash)
|
log.Trace("Discarding already known transaction", "hash", hash)
|
||||||
knownTxMeter.Mark(1)
|
knownTxMeter.Mark(1)
|
||||||
return false, ErrAlreadyKnown
|
return false, txpool.ErrAlreadyKnown
|
||||||
}
|
}
|
||||||
// Make the local flag. If it's from local source or it's from the network but
|
// Make the local flag. If it's from local source or it's from the network but
|
||||||
// the sender is marked as local previously, treat it as the local transaction.
|
// the sender is marked as local previously, treat it as the local transaction.
|
||||||
|
|
@ -1156,7 +1152,7 @@ func (pool *LegacyPool) Add(txs []*types.Transaction, local, sync bool) []error
|
||||||
for i, tx := range txs {
|
for i, tx := range txs {
|
||||||
// If the transaction is known, pre-set the error slot
|
// If the transaction is known, pre-set the error slot
|
||||||
if pool.all.Get(tx.Hash()) != nil {
|
if pool.all.Get(tx.Hash()) != nil {
|
||||||
errs[i] = ErrAlreadyKnown
|
errs[i] = txpool.ErrAlreadyKnown
|
||||||
knownTxMeter.Mark(1)
|
knownTxMeter.Mark(1)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue