diff options
Diffstat (limited to 'src/ark/manager.js')
| -rw-r--r-- | src/ark/manager.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ark/manager.js b/src/ark/manager.js index 310bab5..e35bb89 100644 --- a/src/ark/manager.js +++ b/src/ark/manager.js @@ -122,7 +122,13 @@ export class ArkManager { balance() { const sum = (st) => this.state.vtxos.filter((v) => v.state === st).reduce((n, v) => n + v.amountSat, 0); - return { spendableSat: sum('spendable'), pendingSat: sum('pending') }; + // Boards whose funding tx is broadcast but whose vtxo isn't registered yet: + // the sats have left the on-chain balance, so surface them here instead of + // letting them vanish until the board completes. + const boardingSat = this.state.actions + .filter((a) => a.type === 'board' && a.fundingTxid && !['done', 'failed'].includes(a.step)) + .reduce((n, a) => n + (a.amountSat - a.feeSat), 0); + return { spendableSat: sum('spendable'), pendingSat: sum('pending'), boardingSat }; } // Receives newer than the last acknowledgement — the UI's "Payment |
