mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-04 12:34:14 +01:00
Check if user already has onion node before adding it
This commit is contained in:
@@ -157,7 +157,10 @@ Future defaultSettingsMigration(
|
|||||||
Future<void> addOnionNode(Box<Node> nodes) async {
|
Future<void> addOnionNode(Box<Node> nodes) async {
|
||||||
final onionNodeUri = "cakexmrl7bonq7ovjka5kuwuyd3f7qnkz6z6s6dmsy3uckwra7bvggyd.onion:18081";
|
final onionNodeUri = "cakexmrl7bonq7ovjka5kuwuyd3f7qnkz6z6s6dmsy3uckwra7bvggyd.onion:18081";
|
||||||
|
|
||||||
await nodes.add(Node(uri: onionNodeUri, type: WalletType.monero));
|
// check if the user has this node before (added it manually)
|
||||||
|
if (nodes.values.firstWhereOrNull((element) => element.uriRaw == onionNodeUri) == null) {
|
||||||
|
await nodes.add(Node(uri: onionNodeUri, type: WalletType.monero));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> replaceNodesMigration({required Box<Node> nodes}) async {
|
Future<void> replaceNodesMigration({required Box<Node> nodes}) async {
|
||||||
|
|||||||
Reference in New Issue
Block a user