Attempt aggressive caching

This commit is contained in:
Patrick O'Grady 2020-10-27 22:41:51 -07:00
parent 311eb6988c
commit 46da44d520
No known key found for this signature in database
GPG key ID: 8DE11C985C0C8D85

View file

@ -455,15 +455,11 @@ func (i *Indexer) getCoin(
m, ok := i.coinMap[coinIdentifier.Identifier]
i.coinMapMutex.RUnlock()
if ok {
fmt.Println("used cache", coinIdentifier.Identifier)
return m.Coin, m.Account, nil
}
return i.coinStorage.GetCoinTransactional(
ctx,
dbTx,
coinIdentifier,
)
// THis is SUPER dangerous (won't survive restart)
return nil, nil, storage.ErrCoinNotFound
}
func (i *Indexer) findCoin(