@@ -170,7 +170,7 @@ func (p *proofCache) insertProof(id universe.Identifier,
170170 id .StringForLog (), leafKey , proofKey [:])
171171
172172 proofVal := cachedProof (proof )
173- assetProofCache .Put (proofKey , & proofVal )
173+ _ , _ = assetProofCache .Put (proofKey , & proofVal )
174174}
175175
176176// delProofsForAsset deletes all the proofs for the given asset.
@@ -215,15 +215,15 @@ type rootPageCache = lru.Cache[rootPageQuery, universeRootPage]
215215type atomicRootCache = atomic.Pointer [rootPageCache ]
216216
217217// newAtomicRootCache creates a new atomic root cache.
218- func newAtomicRootCache () atomicRootCache {
218+ func newAtomicRootCache () * atomicRootCache {
219219 rootCache := lru.NewCache [rootPageQuery , universeRootPage ](
220220 numCachedProofs ,
221221 )
222222
223223 var a atomicRootCache
224224 a .Store (rootCache )
225225
226- return a
226+ return & a
227227}
228228
229229// rootIndex maps a tree ID to a universe root.
@@ -233,21 +233,21 @@ type rootIndex = lnutils.SyncMap[treeID, *universe.Root]
233233type atomicRootIndex = atomic.Pointer [rootIndex ]
234234
235235// newAtomicRootIndex creates a new atomic root index.
236- func newAtomicRootIndex () atomicRootIndex {
236+ func newAtomicRootIndex () * atomicRootIndex {
237237 var a atomicRootIndex
238238 a .Store (& rootIndex {})
239239
240- return a
240+ return & a
241241}
242242
243243// rootNodeCache is used to cache the set of active root nodes for the
244244// multiverse tree.
245245type rootNodeCache struct {
246246 sync.RWMutex
247247
248- rootIndex atomicRootIndex
248+ rootIndex * atomicRootIndex
249249
250- allRoots atomicRootCache
250+ allRoots * atomicRootCache
251251
252252 * cacheLogger
253253
@@ -321,10 +321,12 @@ func (r *rootNodeCache) cacheRoots(q universe.RootNodesQuery,
321321
322322 // Store the main root pointer, then update the root index.
323323 rootPageCache := r .allRoots .Load ()
324- rootPageCache .Put (newRootPageQuery (q ), rootNodes )
324+ _ , _ = rootPageCache .Put (newRootPageQuery (q ), rootNodes )
325325
326326 rootIndex := r .rootIndex .Load ()
327327 for _ , rootNode := range rootNodes {
328+ rootNode := rootNode
329+
328330 idStr := treeID (rootNode .ID .String ())
329331 rootIndex .Store (idStr , & rootNode )
330332 }
@@ -451,11 +453,11 @@ func (u *universeLeafCache) cacheLeafKeys(q universe.UniverseLeafKeysQuery,
451453 }
452454
453455 // Store the cache in the top level cache.
454- u .leafCache .Put (idStr , pageCache )
456+ _ , _ = u .leafCache .Put (idStr , pageCache )
455457 }
456458
457459 // Add the to the page cache.
458- pageCache .Put (newLeafQuery (q ), & cachedKeys )
460+ _ , _ = pageCache .Put (newLeafQuery (q ), & cachedKeys )
459461}
460462
461463// wipeCache wipes the cache of leaf keys for a given universe ID.
0 commit comments