aboutsummaryrefslogtreecommitdiff
path: root/main.qml
diff options
context:
space:
mode:
authorxiphon <xiphon@protonmail.com>2019-02-17 14:33:12 +0000
committerxiphon <xiphon@protonmail.com>2019-02-17 14:40:03 +0000
commit3aff7ddcef593df2ac3448164b8a9abf33f8aaf5 (patch)
tree924384d76178310c7f7ce4ec46c9476061317d3b /main.qml
parent0064e595c3f5fc8cc47564a839cc310182e07fe0 (diff)
downloadmonzero-gui-3aff7ddcef593df2ac3448164b8a9abf33f8aaf5.tar.gz
monzero-gui-3aff7ddcef593df2ac3448164b8a9abf33f8aaf5.tar.xz
monzero-gui-3aff7ddcef593df2ac3448164b8a9abf33f8aaf5.zip
Fix default daemon/remote node RPC port based on the network type
Diffstat (limited to 'main.qml')
-rw-r--r--main.qml15
1 files changed, 13 insertions, 2 deletions
diff --git a/main.qml b/main.qml
index 7de16518..68267116 100644
--- a/main.qml
+++ b/main.qml
@@ -78,7 +78,7 @@ ApplicationWindow {
property bool androidCloseTapped: false;
property int userLastActive; // epoch
// Default daemon addresses
- readonly property string localDaemonAddress : persistentSettings.nettype == NetworkType.MAINNET ? "localhost:18081" : persistentSettings.nettype == NetworkType.TESTNET ? "localhost:28081" : "localhost:38081"
+ readonly property string localDaemonAddress : "localhost:" + getDefaultDaemonRpcPort(persistentSettings.nettype)
property string currentDaemonAddress;
property bool startLocalNodeCancelled: false
property int estimatedBlockchainSize: 50 // GB
@@ -1030,7 +1030,7 @@ ApplicationWindow {
property bool allow_background_mining : false
property bool miningIgnoreBattery : true
property var nettype: NetworkType.MAINNET
- property string daemon_address: nettype == NetworkType.TESTNET ? "localhost:28081" : nettype == NetworkType.STAGENET ? "localhost:38081" : "localhost:18081"
+ property string daemon_address: "localhost:" + getDefaultDaemonRpcPort(nettype)
property string payment_id
property int restore_height : 0
property bool is_recovering : false
@@ -1891,6 +1891,17 @@ ApplicationWindow {
passwordDialog.open();
}
+ function getDefaultDaemonRpcPort(networkType) {
+ switch (networkType) {
+ case NetworkType.STAGENET:
+ return 38081;
+ case NetworkType.TESTNET:
+ return 28081;
+ default:
+ return 18081;
+ }
+ }
+
// Daemon console
DaemonConsole {
id: daemonConsolePopup