diff --git a/packages/neuron-wallet/src/block-sync-renderer/sync/light-connector.ts b/packages/neuron-wallet/src/block-sync-renderer/sync/light-connector.ts index 3ea2fb05ec..5e546d673b 100644 --- a/packages/neuron-wallet/src/block-sync-renderer/sync/light-connector.ts +++ b/packages/neuron-wallet/src/block-sync-renderer/sync/light-connector.ts @@ -248,14 +248,14 @@ export default class LightConnector extends Connector { .createBatchRequest<'getTransaction', string[], TransactionWithStatus[]>(txHashes.map(v => ['getTransaction', v])) .exec() const previousTxHashes = new Set() - transactions.forEach(tx => { - tx.transaction.inputs.forEach(input => { + transactions + .flatMap(tx => tx.transaction.inputs) + .forEach(input => { const previousTxHash = input.previousOutput!.txHash if (previousTxHash !== `0x${'0'.repeat(64)}`) { previousTxHashes.add(previousTxHash) } }) - }) await this.lightRpc.createBatchRequest([...previousTxHashes].map(v => ['fetchTransaction' as keyof Base, v])).exec() } diff --git a/packages/neuron-wallet/src/block-sync-renderer/sync/queue.ts b/packages/neuron-wallet/src/block-sync-renderer/sync/queue.ts index 66b9cbc4a9..e53df531d4 100644 --- a/packages/neuron-wallet/src/block-sync-renderer/sync/queue.ts +++ b/packages/neuron-wallet/src/block-sync-renderer/sync/queue.ts @@ -90,6 +90,7 @@ export default class Queue { while (true) { try { await this.#checkAndSave(txHashes) + process.send?.({ channel: 'tx-db-changed' }) break } catch (error) { logger.error('retry saving transactions in 2 seconds due to error:', error)