Wallet: explicitly set trusted daemon flag

This commit is contained in:
xiphon
2019-08-06 15:36:35 +00:00
parent 0461a28701
commit 30a3abedbe
3 changed files with 22 additions and 12 deletions

View File

@@ -385,11 +385,21 @@ ApplicationWindow {
currentDaemonAddress = localDaemonAddress
console.log("initializing with daemon address: ", currentDaemonAddress)
currentWallet.initAsync(currentDaemonAddress, 0, persistentSettings.is_recovering, persistentSettings.is_recovering_from_device, persistentSettings.restore_height);
currentWallet.initAsync(
currentDaemonAddress,
isTrustedDaemon(),
0,
persistentSettings.is_recovering,
persistentSettings.is_recovering_from_device,
persistentSettings.restore_height);
// save wallet keys in case wallet settings have been changed in the init
currentWallet.setPassword(walletPassword);
}
function isTrustedDaemon() {
return !persistentSettings.useRemoteNode || persistentSettings.is_trusted_daemon;
}
function walletPath() {
var wallet_path = persistentSettings.wallet_path
return wallet_path;
@@ -604,7 +614,7 @@ ApplicationWindow {
console.log("connecting remote node");
persistentSettings.useRemoteNode = true;
currentDaemonAddress = persistentSettings.remoteNodeAddress;
currentWallet.initAsync(currentDaemonAddress);
currentWallet.initAsync(currentDaemonAddress, isTrustedDaemon());
walletManager.setDaemonAddressAsync(currentDaemonAddress);
}
@@ -615,7 +625,7 @@ ApplicationWindow {
console.log("disconnecting remote node");
persistentSettings.useRemoteNode = false;
currentDaemonAddress = localDaemonAddress
currentWallet.initAsync(currentDaemonAddress);
currentWallet.initAsync(currentDaemonAddress, isTrustedDaemon());
walletManager.setDaemonAddressAsync(currentDaemonAddress);
}