File tree 1 file changed +8
-10
lines changed
nightfall-client/src/services
1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -45,15 +45,13 @@ from commitments collection and decrypts commitments belonging to the new ivk(s)
45
45
*/
46
46
export async function clientCommitmentSync ( ivk , nsk ) {
47
47
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 ) ;
58
56
}
59
57
}
You can’t perform that action at this time.
0 commit comments