Skip to content

Commit

Permalink
Consider fedimint balance for on chain sends
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyRonning committed May 9, 2024
1 parent 0e6691e commit 2825ae2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/routes/Send.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,15 @@ export function Send() {
});

const maxOnchain = createMemo(() => {
return (
(state.balance?.confirmed ?? 0n) +
(state.balance?.unconfirmed ?? 0n)
);
const conf = state.balance?.confirmed ?? 0n;
const unc = state.balance?.unconfirmed ?? 0n;
const fed = state.balance?.federation ?? 0n;

if (fed > conf + unc) {
return fed;
} else {
return conf + unc;
}
});

const maxLightning = createMemo(() => {
Expand Down

0 comments on commit 2825ae2

Please sign in to comment.