Skip to content

Commit

Permalink
fix caching item order
Browse files Browse the repository at this point in the history
  • Loading branch information
billettc committed Sep 21, 2023
1 parent 56de0af commit 81668b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions accountresolver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ func (r *KVDBAccountsResolver) Resolve(ctx context.Context, atBlockNum uint64, k
_, keyBlockNum := Keys.unpackTableLookup(item.Key)
accounts := decodeAccounts(item.Value)

r.cache[key.base58()] = append([]*cacheItem{{
r.cache[key.base58()] = append(r.cache[key.base58()], &cacheItem{
blockNum: keyBlockNum,
accounts: accounts,
}}, r.cache[key.base58()]...)
})
r.logger.Debug("caching item", zap.Uint64("key_block_num", keyBlockNum), zap.String("key", key.base58()))

if keyBlockNum <= atBlockNum && resolvedAccounts == nil {
Expand Down

0 comments on commit 81668b0

Please sign in to comment.