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

View file

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