privacycash 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/getUtxos.js +11 -13
- package/package.json +1 -1
- package/src/getUtxos.ts +11 -13
package/dist/getUtxos.js
CHANGED
|
@@ -148,19 +148,17 @@ async function fetchUserUtxos({ publicKey, connection, url, storage, encryptionS
|
|
|
148
148
|
if (!data.hasMore) {
|
|
149
149
|
if (cachedString) {
|
|
150
150
|
let cachedEncryptedOutputs = JSON.parse(cachedString);
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
myEncryptedOutputs.push(dres.encryptedOutput);
|
|
163
|
-
}
|
|
151
|
+
if (decryptionTaskFinished % 100 == 0) {
|
|
152
|
+
logger.info(`(decrypting cached utxo: ${decryptionTaskFinished + 1}/${decryptionTaskTotal}...)`);
|
|
153
|
+
}
|
|
154
|
+
let batchRes = await decrypt_outputs(cachedEncryptedOutputs, encryptionService, utxoKeypair, lightWasm);
|
|
155
|
+
decryptionTaskFinished += cachedEncryptedOutputs.length;
|
|
156
|
+
logger.debug('cachedbatchReslen', batchRes.length, ' source', cachedEncryptedOutputs.length);
|
|
157
|
+
for (let i = 0; i < batchRes.length; i++) {
|
|
158
|
+
let dres = batchRes[i];
|
|
159
|
+
if (dres.status == 'decrypted' && dres.utxo) {
|
|
160
|
+
myUtxos.push(dres.utxo);
|
|
161
|
+
myEncryptedOutputs.push(dres.encryptedOutput);
|
|
164
162
|
}
|
|
165
163
|
}
|
|
166
164
|
}
|
package/package.json
CHANGED
package/src/getUtxos.ts
CHANGED
|
@@ -191,19 +191,17 @@ async function fetchUserUtxos({ publicKey, connection, url, storage, encryptionS
|
|
|
191
191
|
if (!data.hasMore) {
|
|
192
192
|
if (cachedString) {
|
|
193
193
|
let cachedEncryptedOutputs = JSON.parse(cachedString)
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
myEncryptedOutputs.push(dres.encryptedOutput!)
|
|
206
|
-
}
|
|
194
|
+
if (decryptionTaskFinished % 100 == 0) {
|
|
195
|
+
logger.info(`(decrypting cached utxo: ${decryptionTaskFinished + 1}/${decryptionTaskTotal}...)`)
|
|
196
|
+
}
|
|
197
|
+
let batchRes = await decrypt_outputs(cachedEncryptedOutputs, encryptionService, utxoKeypair, lightWasm)
|
|
198
|
+
decryptionTaskFinished += cachedEncryptedOutputs.length
|
|
199
|
+
logger.debug('cachedbatchReslen', batchRes.length, ' source', cachedEncryptedOutputs.length)
|
|
200
|
+
for (let i = 0; i < batchRes.length; i++) {
|
|
201
|
+
let dres = batchRes[i]
|
|
202
|
+
if (dres.status == 'decrypted' && dres.utxo) {
|
|
203
|
+
myUtxos.push(dres.utxo)
|
|
204
|
+
myEncryptedOutputs.push(dres.encryptedOutput!)
|
|
207
205
|
}
|
|
208
206
|
}
|
|
209
207
|
}
|