File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1827,6 +1827,16 @@ func (t *lookup) Remove(hash common.Hash) {
1827
1827
delete (t .txs , hash )
1828
1828
}
1829
1829
1830
+ // Clear resets the lookup structure, removing all stored entries.
1831
+ func (t * lookup ) Clear () {
1832
+ t .lock .Lock ()
1833
+ defer t .lock .Unlock ()
1834
+
1835
+ t .slots = 0
1836
+ t .txs = make (map [common.Hash ]* types.Transaction )
1837
+ t .auths = make (map [common.Address ][]common.Hash )
1838
+ }
1839
+
1830
1840
// TxsBelowTip finds all remote transactions below the given tip threshold.
1831
1841
func (t * lookup ) TxsBelowTip (threshold * big.Int ) types.Transactions {
1832
1842
found := make (types.Transactions , 0 , 128 )
@@ -1923,7 +1933,7 @@ func (pool *LegacyPool) Clear() {
1923
1933
for addr := range pool .queue {
1924
1934
pool .reserver .Release (addr )
1925
1935
}
1926
- pool .all = newLookup ()
1936
+ pool .all . Clear ()
1927
1937
pool .priced = newPricedList (pool .all )
1928
1938
pool .pending = make (map [common.Address ]* list )
1929
1939
pool .queue = make (map [common.Address ]* list )
You can’t perform that action at this time.
0 commit comments