mirror of
https://github.com/monero-project/monero-gui.git
synced 2026-04-11 19:27:27 -04:00
Merge pull request #1015
da32161 Use wallet2_api isAddressLocal utils method for isDaemonLocal check
This commit is contained in:
@@ -37,15 +37,6 @@ Rectangle {
|
||||
color: "#F0EEEE"
|
||||
property var currentHashRate: 0
|
||||
|
||||
function isDaemonLocal() {
|
||||
if (appWindow.currentDaemonAddress === "")
|
||||
return false
|
||||
var daemonHost = appWindow.currentDaemonAddress.split(":")[0]
|
||||
if (daemonHost === "127.0.0.1" || daemonHost === "localhost")
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
/* main layout */
|
||||
ColumnLayout {
|
||||
id: mainLayout
|
||||
@@ -75,7 +66,7 @@ Rectangle {
|
||||
fontSize: 18
|
||||
color: "#D02020"
|
||||
text: qsTr("(only available for local daemons)")
|
||||
visible: !isDaemonLocal()
|
||||
visible: !walletManager.isDaemonLocal(appWindow.currentDaemonAddress)
|
||||
}
|
||||
|
||||
Text {
|
||||
@@ -157,7 +148,7 @@ Rectangle {
|
||||
} else {
|
||||
errorPopup.title = qsTr("Error starting mining") + translationManager.emptyString;
|
||||
errorPopup.text = qsTr("Couldn't start mining.<br>")
|
||||
if (!isDaemonLocal())
|
||||
if (!walletManager.isDaemonLocal(appWindow.currentDaemonAddress))
|
||||
errorPopup.text += qsTr("Mining is only available on local daemons. Run a local daemon to be able to mine.<br>")
|
||||
errorPopup.icon = StandardIcon.Critical
|
||||
errorPopup.open()
|
||||
@@ -225,7 +216,7 @@ Rectangle {
|
||||
console.log("Mining page loaded");
|
||||
|
||||
update()
|
||||
timer.running = isDaemonLocal()
|
||||
timer.running = walletManager.isDaemonLocal(appWindow.currentDaemonAddress)
|
||||
|
||||
}
|
||||
function onPageClosed() {
|
||||
|
||||
Reference in New Issue
Block a user