mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-05 07:14:25 +01:00
show unconfirmed balance as well in methodchooser
This commit is contained in:
@@ -65,9 +65,12 @@ export function MethodChooser(props: {
|
||||
{
|
||||
value: "onchain",
|
||||
label: "On-chain Balance",
|
||||
caption: store.balance?.confirmed
|
||||
? `${store.balance?.confirmed.toLocaleString()} SATS`
|
||||
: "No balance"
|
||||
caption:
|
||||
store.balance?.confirmed || store.balance?.unconfirmed
|
||||
? `${(
|
||||
(store.balance?.confirmed || 0n) + (store.balance?.unconfirmed || 0n)
|
||||
).toLocaleString()} SATS`
|
||||
: "No balance"
|
||||
}
|
||||
];
|
||||
});
|
||||
|
||||
@@ -156,7 +156,10 @@ export default function Swap() {
|
||||
return "It's just silly to make a channel smaller than 10,000 sats";
|
||||
}
|
||||
|
||||
if (amountSats() > (state.balance?.confirmed ?? 0n) || !feeEstimate()) {
|
||||
if (
|
||||
amountSats() > (state.balance?.confirmed || 0n) + (state.balance?.unconfirmed || 0n) ||
|
||||
!feeEstimate()
|
||||
) {
|
||||
return "You don't have enough funds to make this channel";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user