Skip to content

Commit

Permalink
f: fix spent addrs
Browse files Browse the repository at this point in the history
  • Loading branch information
coolaj86 committed Aug 14, 2024
1 parent b822a1f commit 1cfe94c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ <h1>Digital Cash Wallet</h1>
disabled
/>
</label>
<hr />
<label
>Coins (<code data-id="total-balance">0.0000</code>)
<small>unspent outputs</small>
Expand Down
9 changes: 6 additions & 3 deletions public/wallet-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@
}

if (balance < satoshis) {
// there's a helper for this in DashTx, including fee calc,
// but this is quick-n-dirty just to get an alert rather than
// checking error types and translating cthe error message
let available = balance / SATS;
let availableStr = available.toFixed(4);
let err = new Error(
Expand Down Expand Up @@ -272,7 +275,7 @@
$('[data-id=send-amount]').textContent = amount.toFixed(8);

let tx = await dashTx.legacy.finalizePresorted(draftTx);
console.log('DEBUG tx', tx);
console.log('DEBUG signed tx', tx);
{
let amountStr = amount.toFixed(4);
let confirmed = window.confirm(`Really send ${amountStr} to ${address}?`);
Expand Down Expand Up @@ -443,9 +446,9 @@
continue; // used address (only check on manual sync)
}

let knownSpent = spentAddrs.includes(info.address);
let knownSpent = spentAddrs.includes(address);
if (!knownSpent) {
spentAddrs.push(info.address);
spentAddrs.push(address);
}
removeElement(addrs, info.address);
removeElement(addresses, info.address);
Expand Down

0 comments on commit 1cfe94c

Please sign in to comment.