Skip to content

Commit

Permalink
Change default haven node to nodes.havenprotocol.org:443
Browse files Browse the repository at this point in the history
  • Loading branch information
mkyq committed May 18, 2022
1 parent 08ffaaa commit aacc901
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
4 changes: 1 addition & 3 deletions assets/haven_node_list.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
-
uri: vault.havenprotocol.org:443
login: super
password: super
uri: nodes.havenprotocol.org:443
useSSL: true
is_default: true
17 changes: 16 additions & 1 deletion lib/entities/default_settings_migration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import 'package:encrypt/encrypt.dart' as encrypt;
const newCakeWalletMoneroUri = 'xmr-node.cakewallet.com:18081';
const cakeWalletBitcoinElectrumUri = 'electrum.cakewallet.com:50002';
const cakeWalletLitecoinElectrumUri = 'ltc-electrum.cakewallet.com:50002';
const havenDefaultNodeUri = 'vault.havenprotocol.org:443';
const havenDefaultNodeUri = 'nodes.havenprotocol.org:443';

Future defaultSettingsMigration(
{@required int version,
Expand Down Expand Up @@ -128,6 +128,10 @@ Future defaultSettingsMigration(
await checkCurrentNodes(nodes, sharedPreferences);
break;

case 17:
await changeDefaultHavenNode(nodes);
break;

default:
break;
}
Expand Down Expand Up @@ -452,3 +456,14 @@ Future<void> resetBitcoinElectrumServer(

await oldElectrumServer?.delete();
}

Future<void> changeDefaultHavenNode(
Box<Node> nodeSource) async {
const previousHavenDefaultNodeUri = 'vault.havenprotocol.org:443';
final havenNodes = nodeSource.values.where(
(node) => node.uriRaw == previousHavenDefaultNodeUri);
havenNodes.forEach((node) async {
node.uriRaw = havenDefaultNodeUri;
await node.save();
});
}
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Future<void> main() async {
exchangeTemplates: exchangeTemplates,
transactionDescriptions: transactionDescriptions,
secureStorage: secureStorage,
initialMigrationVersion: 16);
initialMigrationVersion: 17);
runApp(App());
} catch (e) {
runApp(MaterialApp(
Expand Down

0 comments on commit aacc901

Please sign in to comment.