Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lightning): ldk pay timeout #1507

Merged
merged 2 commits into from
Jan 18, 2024
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
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ android {
applicationId "to.synonym.bitkit.wallet"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 92
versionCode 96
versionName "1.0"
multiDexEnabled true
missingDimensionStrategy 'react-native-camera', 'general'
Expand Down
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ PODS:
- React-Core
- react-native-keep-awake (1.2.2):
- React-Core
- react-native-ldk (0.0.126):
- react-native-ldk (0.0.127):
- React
- react-native-mmkv (2.10.2):
- MMKV (>= 1.2.13)
Expand Down Expand Up @@ -905,7 +905,7 @@ SPEC CHECKSUMS:
react-native-flipper: 9c1957af24b76493ba74f46d000a5c1d485e7731
react-native-image-picker: 2e2e82aba9b6a91a7c78f7d9afde341a2659c7b8
react-native-keep-awake: ad1d67f617756b139536977a0bf06b27cec0714a
react-native-ldk: f45ad0a5397824c7d3f5c4c32503adea6106b4f4
react-native-ldk: 4ab3d26d5e1356313c572814289cc516dc18dd88
react-native-mmkv: 9ae7ca3977e8ef48dbf7f066974eb844c20b5fd7
react-native-netinfo: 5ddbf20865bcffab6b43d0e4e1fd8b3896beb898
react-native-quick-base64: a5dbe4528f1453e662fcf7351029500b8b63e7bb
Expand Down
4 changes: 2 additions & 2 deletions ios/bitkit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 92;
CURRENT_PROJECT_VERSION = 96;
DEVELOPMENT_TEAM = KYH47R284B;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = bitkit/Info.plist;
Expand Down Expand Up @@ -587,7 +587,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 92;
CURRENT_PROJECT_VERSION = 96;
DEVELOPMENT_TEAM = KYH47R284B;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = bitkit/Info.plist;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bitkit",
"author": "Synonym",
"version": "1.0.0-beta.92",
"version": "1.0.0-beta.96",
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
Expand Down Expand Up @@ -51,7 +51,7 @@
"@synonymdev/blocktank-client": "0.0.50",
"@synonymdev/blocktank-lsp-http-client": "0.9.0",
"@synonymdev/feeds": "2.1.1",
"@synonymdev/react-native-ldk": "0.0.126",
"@synonymdev/react-native-ldk": "0.0.127",
"@synonymdev/react-native-lnurl": "0.0.7",
"@synonymdev/result": "0.0.2",
"@synonymdev/slashtags-auth": "1.0.0-alpha.6",
Expand Down
2 changes: 1 addition & 1 deletion src/store/utils/lightning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export const syncLightningTxsWithActivityList = async (): Promise<
const sentTxs = await getSentLightningPayments();
for (const tx of sentTxs) {
const sats = tx.amount_sat;
if (!sats || tx.state !== 'successful') {
if (!sats || tx.state === 'failed') {
continue;
}

Expand Down
2 changes: 2 additions & 0 deletions src/utils/lightning/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,8 @@ export const payLightningInvoice = async (
timeout: 60000,
});
if (payResponse.isErr()) {
//On occasion a payment can time out but still be pending, so we need to sync with react-native-ldk's stored pending payments
await syncLightningTxsWithActivityList();
return err(payResponse.error.message);
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3185,10 +3185,10 @@
dependencies:
b4a "^1.5.3"

"@synonymdev/[email protected].126":
version "0.0.126"
resolved "https://registry.yarnpkg.com/@synonymdev/react-native-ldk/-/react-native-ldk-0.0.126.tgz#78a2b131768e4808add5209c8b8b1f98bab472af"
integrity sha512-tdGisOlxTLe9VblkXjEAyQffaPmXHbZrDuWBw0SBaKenX3j8gW9wm87oOWLl5BrD+D31I6iJqLQoeCo/dp5qZw==
"@synonymdev/[email protected].127":
version "0.0.127"
resolved "https://registry.yarnpkg.com/@synonymdev/react-native-ldk/-/react-native-ldk-0.0.127.tgz#01dbf45319b9003adba111934a3723345a3a461c"
integrity sha512-CmPCq6C8Km55Zg35uM8wfFwY4GtqVQLHOJ1ppmEB36auGvCa0mdfOi7zUaRBw9E4c3W5fnOnAzeReju5WFyR5Q==
dependencies:
bech32 "^2.0.0"
bitcoinjs-lib "^6.0.2"
Expand Down
Loading