Skip to content

Commit

Permalink
fix: calculations in ReceiveConnect
Browse files Browse the repository at this point in the history
  • Loading branch information
limpbrains committed Nov 14, 2024
1 parent e33b684 commit 1101a26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/screens/Wallets/Receive/ReceiveConnect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const ReceiveConnect = ({
const { maxChannelSizeSat } = blocktank.options;
const minChannelSize = Math.round(amount * 2.5);
const maxChannelSize = Math.round(maxChannelSizeSat / 2);
const channelSize = Math.max(minChannelSize, maxChannelSize);
const channelSize = Math.min(minChannelSize, maxChannelSize);
const lspBalance = channelSize - amount;
const payAmount = amount - feeEstimate;
const displayFee = useDisplayValues(feeEstimate);
Expand Down Expand Up @@ -76,7 +76,7 @@ const ReceiveConnect = ({
const onContinue = async (): Promise<void> => {
setIsLoading(true);
const cJitEntryResponse = await createCJitEntry({
channelSize: channelSize,
channelSize,
invoiceAmount: amount,
invoiceDescription: message,
});
Expand All @@ -86,6 +86,7 @@ const ReceiveConnect = ({
title: t('receive_cjit_error'),
description: cJitEntryResponse.error.message,
});
setIsLoading(false);
return;
}
const order = cJitEntryResponse.value;
Expand Down

0 comments on commit 1101a26

Please sign in to comment.