graph/db: completely remove cache from KVStore

This commit is contained in:
Elle Mouton committed 2025-03-24 15:05:47 +02:00
1 parent ba1d21d5c7
commit bb3839e422
3 files changed
+1 -14

No files matched your search

+1 -11
View File
@@ -184,13 +184,12 @@ const (
type KVStore struct {
db kvdb.Backend
// cacheMu guards all caches (rejectCache, chanCache, graphCache). If
// cacheMu guards all caches (rejectCache and chanCache). If
// this mutex will be acquired at the same time as the DB mutex then
// the cacheMu MUST be acquired first to prevent deadlock.
cacheMu sync.RWMutex
rejectCache *rejectCache
chanCache *channelCache
graphCache *GraphCache
chanScheduler batch.Scheduler
nodeScheduler batch.Scheduler
@@ -227,15 +226,6 @@ func NewKVStore(db kvdb.Backend, options ...KVStoreOptionModifier) (*KVStore,
return g, nil
}
// setGraphCache sets the KVStore's graphCache.
//
// NOTE: this is temporary and will only be called from the ChannelGraph's
// constructor before the KVStore methods are available to be called. This will
// be removed once the graph cache is fully owned by the ChannelGraph.
func (c *KVStore) setGraphCache(cache *GraphCache) {
c.graphCache = cache
}
// channelMapKey is the key structure used for storing channel edge policies.
type channelMapKey struct {
nodeKey route.Vertex