From 2772cbb4a31925a9920f6ce80e44c7b5d6f6f50d Mon Sep 17 00:00:00 2001 From: jojobyte <184880+jojobyte@users.noreply.github.com> Date: Mon, 30 Oct 2023 03:27:19 -0600 Subject: [PATCH] fix(data): :monocle_face: update based on all addresses in store --- src/helpers/wallet.js | 6 +++--- src/main.js | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/helpers/wallet.js b/src/helpers/wallet.js index 7a1a2ea..d6f74dd 100644 --- a/src/helpers/wallet.js +++ b/src/helpers/wallet.js @@ -35,9 +35,9 @@ export async function initDashSocket( await dashsocket.init() .catch((e) => console.log('dashsocket catch err', e)); - setTimeout(() => { - dashsocket.close() - }, 15*60*1000); + // setTimeout(() => { + // dashsocket.close() + // }, 15*60*1000); return dashsocket } diff --git a/src/main.js b/src/main.js index 027754e..45f5b8b 100644 --- a/src/main.js +++ b/src/main.js @@ -554,6 +554,7 @@ async function main() { .catch(err => console.error('catch updateAllFunds', err, wallet)) let addr = wallet?.address + let addrs = (await store.addresses.keys()) || [] initDashSocket({ onMessage: async function (evname, data) { @@ -586,8 +587,11 @@ async function main() { // } // } + // console.log('init dash socket vout', data.vout) + let result = data.vout.some(function (vout) { - if (!(addr in vout)) { + let v = Object.keys(vout) + if (!addrs.includes(v[0])) { return false; } @@ -623,7 +627,7 @@ async function main() { // result = newTx; console.log( - 'found main address', + 'found address in store', addr, newTx, ) @@ -633,7 +637,7 @@ async function main() { if (result) { console.log( - 'socket found main address', + 'socket found address in store', addr, ) }