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); }