Merge pull request #1943

3aff7dd Fix default daemon/remote node RPC port based on the network type (xiphon)
This commit is contained in:
luigi1111
2019-02-21 14:15:39 -06:00
3 changed files with 17 additions and 6 deletions

View File

@@ -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_trusted_daemon : false
@@ -1892,6 +1892,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