mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
rename DropTransactions -> Clear
This commit is contained in:
parent
6738987786
commit
5842b1db62
5 changed files with 11 additions and 11 deletions
|
|
@ -1715,14 +1715,14 @@ func (p *BlobPool) Status(hash common.Hash) txpool.TxStatus {
|
||||||
return txpool.TxStatusUnknown
|
return txpool.TxStatusUnknown
|
||||||
}
|
}
|
||||||
|
|
||||||
// DropTransactions implements txpool.SubPool, removing all tracked transactions
|
// Clear implements txpool.SubPool, removing all tracked transactions
|
||||||
// from the blob pool and persistent store.
|
// from the blob pool and persistent store.
|
||||||
func (p *BlobPool) DropTransactions() {
|
func (p *BlobPool) Clear() {
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
defer p.lock.Unlock()
|
defer p.lock.Unlock()
|
||||||
|
|
||||||
// manually iterating and deleting every entry is super sub-optimal
|
// manually iterating and deleting every entry is super sub-optimal
|
||||||
// However, DropTransactions is not currently used in production so
|
// However, Clear is not currently used in production so
|
||||||
// performance is not critical at the moment.
|
// performance is not critical at the moment.
|
||||||
for _, entry := range p.lookup {
|
for _, entry := range p.lookup {
|
||||||
if err := p.store.Delete(entry); err != nil {
|
if err := p.store.Delete(entry); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -1962,9 +1962,9 @@ func numSlots(tx *types.Transaction) int {
|
||||||
return int((tx.Size() + txSlotSize - 1) / txSlotSize)
|
return int((tx.Size() + txSlotSize - 1) / txSlotSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DropTransactions implements txpool.SubPool, removing all tracked txs from the pool
|
// Clear implements txpool.SubPool, removing all tracked txs from the pool
|
||||||
// and rotating the journal.
|
// and rotating the journal.
|
||||||
func (p *LegacyPool) DropTransactions() {
|
func (p *LegacyPool) Clear() {
|
||||||
p.mu.Lock()
|
p.mu.Lock()
|
||||||
defer p.mu.Unlock()
|
defer p.mu.Unlock()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -169,6 +169,6 @@ type SubPool interface {
|
||||||
// identified by their hashes.
|
// identified by their hashes.
|
||||||
Status(hash common.Hash) TxStatus
|
Status(hash common.Hash) TxStatus
|
||||||
|
|
||||||
// DropTransactions removes all tracked transactions from the pool
|
// Clear removes all tracked transactions from the pool
|
||||||
DropTransactions()
|
Clear()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -498,9 +498,9 @@ func (p *TxPool) Sync() error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DropTransactions removes all tracked txs from the subpools.
|
// Clear removes all tracked txs from the subpools.
|
||||||
func (p *TxPool) DropTransactions() {
|
func (p *TxPool) Clear() {
|
||||||
for _, subpool := range p.subpools {
|
for _, subpool := range p.subpools {
|
||||||
subpool.DropTransactions()
|
subpool.Clear()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,7 @@ func (c *SimulatedBeacon) Commit() common.Hash {
|
||||||
|
|
||||||
// Rollback un-sends previously added transactions.
|
// Rollback un-sends previously added transactions.
|
||||||
func (c *SimulatedBeacon) Rollback() {
|
func (c *SimulatedBeacon) Rollback() {
|
||||||
c.eth.TxPool().DropTransactions()
|
c.eth.TxPool().Clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fork sets the head to the provided hash.
|
// Fork sets the head to the provided hash.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue