disconnect temp fix

This commit is contained in:
Matthew Fosse 2024-05-17 12:47:11 -07:00
parent a0ef14b3ed
commit 8a3d8ff4ae

View file

@ -186,7 +186,9 @@ abstract class LightningWalletBase extends ElectrumWallet with Store {
// disconnect if already connected
try {
await sdk.disconnect();
if (await sdk.isInitialized()) {
await sdk.disconnect();
}
} catch (e, s) {
print("ERROR disconnecting from Breez: $e\n$s");
}
@ -232,7 +234,9 @@ abstract class LightningWalletBase extends ElectrumWallet with Store {
Future<void> stopBreez() async {
final sdk = await BreezSDK();
await sdk.disconnect();
if (await sdk.isInitialized()) {
await sdk.disconnect();
}
await _nodeStateSub?.cancel();
await _paymentsSub?.cancel();
}