From e5dfbe906b61c08567dc6a993b1283bc9d40226e Mon Sep 17 00:00:00 2001 From: arobsn <87387688+arobsn@users.noreply.github.com> Date: Fri, 2 Aug 2024 13:21:05 -0300 Subject: [PATCH] fix old utxos check --- src/chains/ergo/services/graphQlService.ts | 2 ++ src/stores/walletStore.ts | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chains/ergo/services/graphQlService.ts b/src/chains/ergo/services/graphQlService.ts index 5d894277..cd57f289 100755 --- a/src/chains/ergo/services/graphQlService.ts +++ b/src/chains/ergo/services/graphQlService.ts @@ -270,6 +270,8 @@ class GraphQLService { } async checkBoxesOlderThan(height: number, addresses: string[]): Promise { + if (isEmpty(addresses)) return false; + const query = gql` query Boxes($maxHeight: Int, $addresses: [String!]) { boxes( diff --git a/src/stores/walletStore.ts b/src/stores/walletStore.ts index 044bca3d..43f18942 100644 --- a/src/stores/walletStore.ts +++ b/src/stores/walletStore.ts @@ -299,8 +299,6 @@ export const useWalletStore = defineStore("wallet", () => { if (Date.now() - privateState.lastSynced < MIN_SYNC_INTERVAL) return setSyncing(false); setSyncing(true); - checkOldUtxos(); - const walletId = privateState.id; const deriver = hdKeyPool.get(privateState.publicKey); const addressesChunks = [] as IDbAddress[][]; @@ -369,6 +367,7 @@ export const useWalletStore = defineStore("wallet", () => { privateState.patchAssets(changedAssets, removedAssets); privateState.lastSynced = Date.now(); + checkOldUtxos(); setSyncing(false); }