Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ PODS:
- React-Core
- react-native-image-picker (5.3.1):
- React-Core
- react-native-ldk (0.0.95):
- react-native-ldk (0.0.96):
- React
- react-native-libsodium (0.7.0):
- React-Core
Expand Down Expand Up @@ -835,7 +835,7 @@ SPEC CHECKSUMS:
react-native-document-picker: 495c444c0c773c6e83a5d91165890ecb1c0a399a
react-native-flipper: 5d8dcbcb905a7e8076c9a61a3709944c23cf48ee
react-native-image-picker: ec9b713e248760bfa0f879f0715391de4651a7cb
react-native-ldk: 3608ec98dc228dc8ea4ca15e68a8b4562be7cfb5
react-native-ldk: d74fff362f75541785d504c78407a1d89efc83e4
react-native-libsodium: 2834a805c906aef4b7609019bcc87e7d9eb86b23
react-native-mmkv: 7da5e18e55c04a9af9a7e0ab9792a1e8d33765a1
react-native-netinfo: 22c082970cbd99071a4e5aa7a612ac20d66b08f0
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@reduxjs/toolkit": "^1.9.3",
"@shopify/react-native-skia": "0.1.182",
"@synonymdev/blocktank-client": "0.0.50",
"@synonymdev/react-native-ldk": "0.0.95",
"@synonymdev/react-native-ldk": "0.0.96",
"@synonymdev/react-native-lnurl": "0.0.3",
"@synonymdev/result": "0.0.2",
"@synonymdev/slashtags-auth": "^1.0.0-alpha.5",
Expand Down
4 changes: 2 additions & 2 deletions src/screens/Settings/AddressViewer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import {
resetActivityStore,
updateActivityList,
} from '../../../store/actions/activity';
import { resetLdk } from '../../../utils/lightning';
import { restartLdk } from '../../../utils/lightning';
import { startWalletServices } from '../../../utils/startup';
import { updateOnchainFeeEstimates } from '../../../store/actions/fees';
import { viewControllerIsOpenSelector } from '../../../store/reselect/ui';
Expand Down Expand Up @@ -820,7 +820,7 @@ const AddressViewer = ({
addressType: config.addressType,
});
// Switching networks requires us to reset LDK.
await resetLdk();
await restartLdk();
// Start wallet services with the newly selected network.
await startWalletServices({
selectedNetwork: config.selectedNetwork,
Expand Down
4 changes: 2 additions & 2 deletions src/screens/Settings/Bitcoin/BitcoinNetworkSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { connectToElectrum } from '../../../utils/wallet/electrum';
import { startWalletServices } from '../../../utils/startup';
import { EAvailableNetworks } from '../../../utils/networks';
import { getNetworkData } from '../../../utils/helpers';
import { resetLdk } from '../../../utils/lightning';
import { restartLdk } from '../../../utils/lightning';
import {
getCurrentWallet,
getSelectedAddressType,
Expand Down Expand Up @@ -62,7 +62,7 @@ const BitcoinNetworkSelection = ({
addressType,
});
// Switching networks requires us to reset LDK.
await resetLdk();
await restartLdk();
// Start wallet services with the newly selected network.
await startWalletServices({ selectedNetwork: network });
await updateOnchainFeeEstimates({
Expand Down
6 changes: 3 additions & 3 deletions src/store/actions/blocktank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
} from '../../utils/notifications';
import { getDisplayValues } from '../../utils/displayValues';
import i18n from '../../utils/i18n';
import { setupLdk } from '../../utils/lightning';
import { refreshLdk } from '../../utils/lightning';
import { TWalletName } from '../types/wallet';
import { IBlocktank } from '../types/blocktank';

Expand Down Expand Up @@ -425,8 +425,8 @@ const handleOrderStateChange = (order: IGetOrderResponse): void => {
removeTodo('transferToSpending');
}

// restart LDK after channel open
setupLdk();
// refresh LDK after channel open
refreshLdk({});
}
};

Expand Down
11 changes: 5 additions & 6 deletions src/utils/lightning/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const wipeLdkStorage = async ({
selectedNetwork = getSelectedNetwork();
}

await ldk.reset();
await ldk.stop();
const path = `${RNFS.DocumentDirectoryPath}/ldk/${lm.account.name}`;

const deleteAllFiles = async (dirpath: string): Promise<void> => {
Expand Down Expand Up @@ -159,7 +159,7 @@ export const setupLdk = async ({
}

// start from a clean slate
await resetLdk();
await ldk.stop();

const account = await getAccount({ selectedWallet });
if (account.isErr()) {
Expand Down Expand Up @@ -414,13 +414,13 @@ export const unsubscribeFromLightningSubscriptions = (): void => {
onSpendableOutputsSubscription?.remove();
};

export const resetLdk = async (): Promise<Result<string>> => {
export const restartLdk = async (): Promise<Result<string>> => {
// wait for interactions/animations to be completed
await new Promise((resolve) => {
InteractionManager.runAfterInteractions(() => resolve(null));
});

return await ldk.reset();
return await ldk.restart();
};

/**
Expand Down Expand Up @@ -450,8 +450,7 @@ export const refreshLdk = async ({

const isRunning = await isLdkRunning();
if (!isRunning) {
await resetLdk();
// Attempt to reset LDK.
// Attempt to setup and start LDK.
const setupResponse = await setupLdk({
selectedNetwork,
selectedWallet,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2603,10 +2603,10 @@
cross-fetch "^3.1.4"
node-fetch "3.1.1"

"@synonymdev/react-native-ldk@0.0.95":
version "0.0.95"
resolved "https://registry.yarnpkg.com/@synonymdev/react-native-ldk/-/react-native-ldk-0.0.95.tgz#b352dd05e4fd0ecc1d720f23ae932660483a900c"
integrity sha512-vT5cVCY9LtxeI+LtwnhbwG6PjH8/BDu6B8bgtOmJvmoHbHPl5QmKh8cRbddaZq2M39SSvWdF8IHKU3y3GF2PeA==
"@synonymdev/react-native-ldk@0.0.96":
version "0.0.96"
resolved "https://registry.yarnpkg.com/@synonymdev/react-native-ldk/-/react-native-ldk-0.0.96.tgz#7fd8d9fc60784ead20f62ca684e30099af146ea9"
integrity sha512-zyvUCmVSM7uidPXgx+X1Ygi0aO9sbjtKmX75GTm2urw2PVESV840DhHcO0ojWYq3efrRYDf3AofDylRjCmHLqw==
dependencies:
bitcoinjs-lib "^6.0.2"

Expand Down