mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 09:47:35 +00:00
Check if user already has onion node before adding it
This commit is contained in:
parent
f54e2ec00e
commit
ffd0079e1d
1 changed files with 4 additions and 1 deletions
|
@ -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";
|
||||||
|
|
||||||
|
// 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));
|
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 {
|
||||||
|
|
Loading…
Reference in a new issue