mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 22:56:43 +00:00
core/txpool: add notice to Clear that is not meant for production code
This commit is contained in:
parent
9f83e9e673
commit
c1b9b76d7e
3 changed files with 9 additions and 0 deletions
|
|
@ -1754,6 +1754,9 @@ func (p *BlobPool) Status(hash common.Hash) txpool.TxStatus {
|
|||
|
||||
// Clear implements txpool.SubPool, removing all tracked transactions
|
||||
// from the blob pool and persistent store.
|
||||
//
|
||||
// Note, do not use this in production / live code. In live code, the pool is
|
||||
// meant to reset on a separate thread to avoid DoS vectors.
|
||||
func (p *BlobPool) Clear() {
|
||||
p.lock.Lock()
|
||||
defer p.lock.Unlock()
|
||||
|
|
|
|||
|
|
@ -1876,6 +1876,9 @@ func numSlots(tx *types.Transaction) int {
|
|||
|
||||
// Clear implements txpool.SubPool, removing all tracked txs from the pool
|
||||
// and rotating the journal.
|
||||
//
|
||||
// Note, do not use this in production / live code. In live code, the pool is
|
||||
// meant to reset on a separate thread to avoid DoS vectors.
|
||||
func (pool *LegacyPool) Clear() {
|
||||
pool.mu.Lock()
|
||||
defer pool.mu.Unlock()
|
||||
|
|
|
|||
|
|
@ -575,6 +575,9 @@ func (p *TxPool) Sync() error {
|
|||
}
|
||||
|
||||
// Clear removes all tracked txs from the subpools.
|
||||
//
|
||||
// Note, do not use this in production / live code. In live code, the pool is
|
||||
// meant to reset on a separate thread to avoid DoS vectors.
|
||||
func (p *TxPool) Clear() {
|
||||
// Invoke Sync to ensure that txs pending addition don't get added to the pool after
|
||||
// the subpools are subsequently cleared
|
||||
|
|
|
|||
Loading…
Reference in a new issue