1
0
Fork 0
mirror of https://github.com/BlueWallet/BlueWallet.git synced 2025-03-26 08:55:56 +01:00

WIP: ldk open channel human-readable errors

This commit is contained in:
Overtorment 2021-10-14 16:26:41 +01:00
parent 0c81dad54b
commit ce5fb97515
4 changed files with 14 additions and 4 deletions

View file

@ -628,6 +628,10 @@ export class LightningLdkWallet extends LightningCustodianWallet {
return RnLdk.getPackageVersion();
}
getChannelsClosedEvents() {
return RnLdk.channelsClosed;
}
/**
* executes async function in background, so calling code can return immediately, while catching all thrown exceptions
* and showing them in alert() instead of propagating them up

4
package-lock.json generated
View file

@ -20903,8 +20903,8 @@
}
},
"rn-ldk": {
"version": "git+https://github.com/BlueWallet/rn-ldk.git#v0.3.2",
"from": "git+https://github.com/BlueWallet/rn-ldk.git#v0.3.2"
"version": "git+https://github.com/BlueWallet/rn-ldk.git#v0.4.0",
"from": "git+https://github.com/BlueWallet/rn-ldk.git#v0.4.0"
},
"rn-nodeify": {
"version": "10.3.0",

View file

@ -190,7 +190,7 @@
"react-test-render": "1.1.2",
"readable-stream": "3.6.0",
"realm": "10.8.0",
"rn-ldk": "git+https://github.com/BlueWallet/rn-ldk.git#v0.3.2",
"rn-ldk": "git+https://github.com/BlueWallet/rn-ldk.git#v0.4.0",
"rn-nodeify": "10.3.0",
"scryptsy": "2.1.0",
"secure-random": "1.1.2",

View file

@ -145,8 +145,14 @@ const LdkOpenChannel = (props: any) => {
console.warn('initiated channel opening');
if (!fundingAddressTemp) {
let reason = '';
const channelsClosed = ldkWallet.getChannelsClosedEvents();
const event = channelsClosed.pop();
if (event) {
reason += event.reason + ' ' + event.text;
}
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
return alert('Initiating channel open failed');
return alert('Initiating channel open failed: ' + reason);
}
psbtOpenChannelStartedTs.current = +new Date();