Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.

Commit 26cc29d

Browse files
committed
fix: do not show SettingUp screen in case of non 0conf BT order
1 parent d636bd3 commit 26cc29d

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

e2e/channels.e2e.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ d('LN Channel Onboarding', () => {
131131
.toBeVisible()
132132
.withTimeout(10000);
133133

134+
await rpc.generateToAddress(1, await rpc.getNewAddress());
135+
134136
// CustomSetup
135137
await launchAndWait();
136138
await waitFor(element(by.id('Suggestion-lightningSettingUp')))

src/screens/Lightning/CustomConfirm.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ const CustomConfirm = ({
7272
setLoading(false);
7373
return;
7474
}
75-
navigation.navigate('SettingUp');
75+
const zeroConf = order.zeroConf && !res.value.useUnconfirmedInputs;
76+
navigation.navigate(zeroConf ? 'SettingUp' : 'Success');
7677
};
7778

7879
const updateOrderExpiration = async (): Promise<void> => {

src/screens/Lightning/QuickConfirm.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ const QuickConfirm = ({
7373
setLoading(false);
7474
return;
7575
}
76-
navigation.navigate('SettingUp');
76+
const zeroConf = order?.zeroConf && !res.value.useUnconfirmedInputs;
77+
navigation.navigate(zeroConf ? 'SettingUp' : 'Success');
7778
};
7879

7980
return (

src/store/actions/blocktank.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { err, ok, Result } from '@synonymdev/result';
33
import actions from './actions';
44
import { resetSendTransaction, updateSendTransaction } from './wallet';
55
import { setLightningSettingUpStep } from './user';
6-
import { getBlocktankStore, getDispatch } from '../helpers';
6+
import { getBlocktankStore, getDispatch, getWalletStore } from '../helpers';
77
import * as blocktank from '../../utils/blocktank';
88
import {
99
createOrder,
@@ -370,7 +370,7 @@ export const confirmChannelPurchase = async ({
370370
orderId: string;
371371
selectedNetwork?: TAvailableNetworks;
372372
selectedWallet?: TWalletName;
373-
}): Promise<Result<string>> => {
373+
}): Promise<Result<{ txid: string; useUnconfirmedInputs: boolean }>> => {
374374
if (!selectedNetwork) {
375375
selectedNetwork = getSelectedNetwork();
376376
}
@@ -387,6 +387,11 @@ export const confirmChannelPurchase = async ({
387387
});
388388
return err(rawTx.error.message);
389389
}
390+
391+
const useUnconfirmedInputs = getWalletStore().wallets[
392+
selectedWallet!
393+
].transaction[selectedNetwork!].inputs.some(({ height }) => height === 0);
394+
390395
const broadcastResponse = await broadcastTransaction({
391396
rawTx: rawTx.value.hex,
392397
subscribeToOutputAddress: false,
@@ -415,7 +420,7 @@ export const confirmChannelPurchase = async ({
415420
selectedNetwork,
416421
}).then();
417422

418-
return ok(broadcastResponse.value);
423+
return ok({ txid: broadcastResponse.value, useUnconfirmedInputs });
419424
};
420425

421426
/**

0 commit comments

Comments
 (0)