diff --git a/packages/neuron-wallet/src/services/indexer/queue.ts b/packages/neuron-wallet/src/services/indexer/queue.ts index 609127bee5..3e10f90410 100644 --- a/packages/neuron-wallet/src/services/indexer/queue.ts +++ b/packages/neuron-wallet/src/services/indexer/queue.ts @@ -59,6 +59,11 @@ export default class IndexerQueue { this.indexed = false } + public appendLockHashInfos = (lockHashInfos: LockHashInfo[]): void => { + const infos = this.lockHashInfos.concat(lockHashInfos) + this.setLockHashInfos(infos) + } + public reset = () => { this.resetFlag = true } diff --git a/packages/neuron-wallet/src/startup/sync-block-task/indexer.ts b/packages/neuron-wallet/src/startup/sync-block-task/indexer.ts index 03cae4e870..10c2a567a0 100644 --- a/packages/neuron-wallet/src/startup/sync-block-task/indexer.ts +++ b/packages/neuron-wallet/src/startup/sync-block-task/indexer.ts @@ -51,7 +51,7 @@ export const switchNetwork = async (nodeURL: string) => { }) }) )).reduce((acc, val) => acc.concat(val), []) - indexerQueue.setLockHashInfos(infos) + indexerQueue.appendLockHashInfos(infos) } })