Skip to content

Commit

Permalink
Fixed electrum server network specific ping & message
Browse files Browse the repository at this point in the history
  • Loading branch information
i5hi committed Dec 24, 2024
1 parent 487c8e0 commit 2014cc3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
41 changes: 22 additions & 19 deletions lib/network/bloc/network_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -387,25 +387,28 @@ class NetworkCubit extends Cubit<NetworkState> {
}

// Connection test with electrum
final mainnetElectrumLive = await isElectrumLive(tempNetwork.mainnet);
if (!mainnetElectrumLive) {
emit(
state.copyWith(
errLoadingNetworks:
'Pls check mainnet electrum URL. Cannot connect to electrum',
),
);
return;
}
final testnetElectrumLive = await isElectrumLive(tempNetwork.testnet);
if (!testnetElectrumLive) {
emit(
state.copyWith(
errLoadingNetworks:
'Pls check testnet electrum URL. Cannot connect to electrum',
),
);
return;
if (state.testnet) {
final testnetElectrumLive = await isElectrumLive(tempNetwork.testnet);
if (!testnetElectrumLive) {
emit(
state.copyWith(
errLoadingNetworks:
'Check Testnet electrum URL. Could not connect to electrum.',
),
);
return;
}
} else {
final mainnetElectrumLive = await isElectrumLive(tempNetwork.mainnet);
if (!mainnetElectrumLive) {
emit(
state.copyWith(
errLoadingNetworks:
'Check Mainnet electrum URL. Could not connect to electrum.',
),
);
return;
}
}

final index =
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: bb_mobile
description: Bull Bitcoin Mobile Wallet
publish_to: "none"
version: 0.3.2+23
version: 0.3.2-4+23

environment:
sdk: ">=3.3.0 <4.0.0"
Expand Down

0 comments on commit 2014cc3

Please sign in to comment.