Skip to content

Commit

Permalink
fix(transfer): fix update channel duration
Browse files Browse the repository at this point in the history
  • Loading branch information
pwltr committed Mar 19, 2024
1 parent 0abf577 commit d919714
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/screens/Lightning/CustomConfirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import { useCurrency, useDisplayValues } from '../../hooks/displayValues';
import NumberPadWeeks from './NumberPadWeeks';
import { LightningScreenProps } from '../../navigation/types';
import { sleep } from '../../utils/helpers';
import { blocktankOrderSelector } from '../../store/reselect/blocktank';
import {
blocktankInfoSelector,
blocktankOrderSelector,
} from '../../store/reselect/blocktank';
import {
confirmChannelPurchase,
startChannelPurchase,
Expand All @@ -42,6 +45,7 @@ const CustomConfirm = ({
const transactionFee = useAppSelector(transactionFeeSelector);
const selectedWallet = useAppSelector(selectedWalletSelector);
const selectedNetwork = useAppSelector(selectedNetworkSelector);
const blocktankInfo = useAppSelector(blocktankInfoSelector);
const order = useAppSelector((state) => {
return blocktankOrderSelector(state, orderId);
});
Expand Down Expand Up @@ -70,11 +74,12 @@ const CustomConfirm = ({
};

const updateOrderExpiration = async (): Promise<void> => {
const max0ConfBalance = blocktankInfo.options.max0ConfClientBalanceSat;
const purchaseResponse = await startChannelPurchase({
remoteBalance: order.clientBalanceSat,
localBalance: order.lspBalanceSat,
channelExpiry: Math.max(weeks, 1),
zeroConfPayment: order.zeroConf,
zeroConfPayment: order.clientBalanceSat <= max0ConfBalance,
selectedWallet,
selectedNetwork,
});
Expand Down

0 comments on commit d919714

Please sign in to comment.