set cache to nil

This commit is contained in:
maskpp 2025-07-30 11:31:39 +08:00
parent 90f83f4b37
commit f4ead0dbba

View file

@ -125,6 +125,9 @@ func (m *SortedMap) Filter(filter func(*types.Transaction) bool) types.Transacti
func (m *SortedMap) reheap() { func (m *SortedMap) reheap() {
*m.index = slices.Collect(maps.Keys(m.items)) *m.index = slices.Collect(maps.Keys(m.items))
heap.Init(m.index) heap.Init(m.index)
m.cacheMu.Lock()
m.cache = nil
m.cacheMu.Unlock()
} }
// filter is identical to Filter, but **does not** regenerate the heap. This method // filter is identical to Filter, but **does not** regenerate the heap. This method