Skip to content

Commit 9ec34b6

Browse files
committed
fix: remove check of getAllTransactions
1 parent c899a4f commit 9ec34b6

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

‎nightfall-client/src/services/commitment-sync.mjs

+8-10
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,13 @@ from commitments collection and decrypts commitments belonging to the new ivk(s)
4545
*/
4646
export async function clientCommitmentSync(ivk, nsk) {
4747
const transactions = await getAllTransactions();
48-
if (typeof transactions !== 'undefined') {
49-
for (let i = 0; i < transactions.length; i++) {
50-
// filter out non zero commitments and nullifiers
51-
const nonZeroCommitments = transactions[i].commitments.flat().filter(n => n !== ZERO);
52-
if (
53-
(transactions[i].transactionType === '1' || transactions[i].transactionType === '2') &&
54-
countCommitments(nonZeroCommitments) === 0
55-
)
56-
decryptCommitment(transactions[i], ivk, nsk);
57-
}
48+
for (let i = 0; i < transactions.length; i++) {
49+
// filter out non zero commitments and nullifiers
50+
const nonZeroCommitments = transactions[i].commitments.flat().filter(n => n !== ZERO);
51+
if (
52+
(transactions[i].transactionType === '1' || transactions[i].transactionType === '2') &&
53+
countCommitments(nonZeroCommitments) === 0
54+
)
55+
decryptCommitment(transactions[i], ivk, nsk);
5856
}
5957
}

0 commit comments

Comments
 (0)