Skip to content

Commit

Permalink
fix(data): 🧐 update based on all addresses in store
Browse files Browse the repository at this point in the history
  • Loading branch information
jojobyte committed Oct 30, 2023
1 parent 68573bf commit 2772cbb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/helpers/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
10 changes: 7 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -623,7 +627,7 @@ async function main() {

// result = newTx;
console.log(
'found main address',
'found address in store',
addr,
newTx,
)
Expand All @@ -633,7 +637,7 @@ async function main() {

if (result) {
console.log(
'socket found main address',
'socket found address in store',
addr,
)
}
Expand Down

0 comments on commit 2772cbb

Please sign in to comment.