mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 12:09:43 +00:00
forgot to add to commit
This commit is contained in:
parent
507b5541f6
commit
884a53f607
2 changed files with 9 additions and 8 deletions
|
@ -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;
|
||||||
});
|
});
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue