diff --git a/lib/entities/default_settings_migration.dart b/lib/entities/default_settings_migration.dart index 1c46cd605..2b8c49631 100644 --- a/lib/entities/default_settings_migration.dart +++ b/lib/entities/default_settings_migration.dart @@ -254,6 +254,7 @@ Future defaultSettingsMigration( case 41: _deselectQuantex(sharedPreferences); await _addSethNode(nodes, sharedPreferences); + await updateTronNodesWithNowNodes(sharedPreferences: sharedPreferences, nodes: nodes); break; default: break; @@ -1317,3 +1318,16 @@ Future removeMoneroWorld( await changeMoneroCurrentNodeToDefault(sharedPreferences: sharedPreferences, nodes: nodes); } } + +Future updateTronNodesWithNowNodes({ + required SharedPreferences sharedPreferences, + required Box nodes, +}) async { + final tronNowNodesUri = 'trx.nownodes.io'; + + if (nodes.values.any((node) => node.uriRaw == tronNowNodesUri)) return; + + await nodes.add(Node(uri: tronNowNodesUri, type: WalletType.tron)); + + await replaceTronDefaultNode(sharedPreferences: sharedPreferences, nodes: nodes); +}