forgot to add to commit

This commit is contained in:
fosse 2024-01-24 13:16:02 -05:00
parent 507b5541f6
commit 884a53f607
2 changed files with 9 additions and 8 deletions

View file

@ -134,6 +134,8 @@ abstract class ElectrumWalletBase
void Function(FlutterErrorDetails)? _onError;
bool torOnly = false;
Future<void> init() async {
await walletAddresses.init();
await transactionHistory.init();
@ -163,16 +165,20 @@ abstract class ElectrumWalletBase
}
}
void setTorOnly(bool value) {
torOnly = value;
}
@action
@override
Future<void> connectToNode({required Node node}) async {
try {
// we can't connect over tor in this wallet type (yet):
if (node.connectOverTorOnly) {
if (torOnly) {
syncStatus = FailedSyncStatus();
return;
}
syncStatus = ConnectingSyncStatus();
await electrumClient.connectToUri(node.uri);
electrumClient.onConnectionStatusChange = (bool isConnected) {
@ -607,8 +613,6 @@ abstract class ElectrumWalletBase
electrumClient.getHistory(scriptHash).then((history) => {scriptHash: history}));
final historyResults = await Future.wait(histories);
historyResults.forEach((history) {
history.entries.forEach((historyItem) {
if (historyItem.value.isNotEmpty) {
@ -628,7 +632,6 @@ abstract class ElectrumWalletBase
}
}
addressHashes.forEach((sh, addressRecord) {
addressRecord.txCount = newTxCounts[sh] ?? 0;
});

View file

@ -62,9 +62,7 @@ class Node extends HiveObject with Keyable {
@HiveField(6)
String? socksProxyAddress;
bool connectOverTorOnly = false;
bool get isSSL => useSSL ?? false;
bool get useSocksProxy => socksProxyAddress == null ? false : socksProxyAddress!.isNotEmpty;