Create haven default node instead of loading from YAML (#544)

This commit is contained in:
Omar Hatem 2022-10-20 00:21:16 +02:00 committed by GitHub
parent a2dfbc6076
commit 3c4ba6da53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -417,8 +417,7 @@ Future<void> checkCurrentNodes(
}
if (currentHavenNodeServer == null) {
final nodes = await loadDefaultHavenNodes();
final node = nodes.first;
final node = Node(uri: havenDefaultNodeUri, type: WalletType.haven);
await nodeSource.add(node);
await sharedPreferences.setInt(
PreferencesKey.currentHavenNodeIdKey, node.key as int);

View file

@ -50,6 +50,9 @@ abstract class NodeListViewModelBase with Store {
case WalletType.litecoin:
node = getLitecoinDefaultElectrumServer(nodes: _nodeSource)!;
break;
case WalletType.haven:
node = getHavenDefaultNode(nodes: _nodeSource)!;
break;
default:
throw Exception('Unexpected wallet type: ${wallet.type}');
}