fix: account caching

This commit is contained in:
bartosz-lipinski 2020-12-16 22:58:48 -06:00
parent 179e4352bc
commit 2cefc186de
1 changed files with 2 additions and 1 deletions

View File

@ -311,7 +311,8 @@ export function AccountsProvider({ children = null as any }) {
if (info.accountInfo.data.length === AccountLayout.span) { if (info.accountInfo.data.length === AccountLayout.span) {
const data = deserializeAccount(info.accountInfo.data); const data = deserializeAccount(info.accountInfo.data);
if (PRECACHED_OWNERS.has(data.owner.toBase58()) || !cache.get(id)) { if (PRECACHED_OWNERS.has(data.owner.toBase58()) || cache.get(id)) {
console.log(id);
cache.add(id, info.accountInfo, TokenAccountParser); cache.add(id, info.accountInfo, TokenAccountParser);
setTokenAccounts(selectUserAccounts()); setTokenAccounts(selectUserAccounts());
accountEmitter.raiseAccountUpdated(id); accountEmitter.raiseAccountUpdated(id);