stopping wallet rpc instance does not assume to close wallet

This commit is contained in:
woodser 2022-06-27 21:21:32 -04:00
parent 7ad2e20d95
commit f17c5803b5
3 changed files with 17 additions and 9 deletions

View File

@ -97,9 +97,8 @@ public class MoneroWalletRpcManager {
* Stop an instance of monero-wallet-rpc.
*
* @param walletRpc the client connected to the monero-wallet-rpc instance to stop
* @param save specifies if the wallet should be saved before closing
*/
public void stopInstance(MoneroWalletRpc walletRpc, boolean save) {
public void stopInstance(MoneroWalletRpc walletRpc) {
// unregister port
synchronized (registeredPorts) {
@ -118,8 +117,7 @@ public class MoneroWalletRpcManager {
if (!found) throw new RuntimeException("MoneroWalletRpc instance not registered with a port");
}
// close wallet and stop process
walletRpc.close(save);
// stop process
walletRpc.stopProcess();
}

View File

@ -40,6 +40,7 @@ import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.inject.Inject;
import monero.common.MoneroError;
import monero.common.MoneroRpcConnection;
import monero.common.MoneroUtils;
import monero.daemon.MoneroDaemon;
@ -434,7 +435,7 @@ public class XmrWalletService {
return walletRpc;
} catch (Exception e) {
e.printStackTrace();
MONERO_WALLET_RPC_MANAGER.stopInstance(walletRpc, false);
MONERO_WALLET_RPC_MANAGER.stopInstance(walletRpc);
throw e;
}
}
@ -451,7 +452,7 @@ public class XmrWalletService {
return walletRpc;
} catch (Exception e) {
e.printStackTrace();
MONERO_WALLET_RPC_MANAGER.stopInstance(walletRpc, false);
MONERO_WALLET_RPC_MANAGER.stopInstance(walletRpc);
throw e;
}
}
@ -549,7 +550,14 @@ public class XmrWalletService {
private void closeWallet(MoneroWallet walletRpc, boolean save) {
log.info("{}.closeWallet({}, {})", getClass().getSimpleName(), walletRpc.getPath(), save);
MONERO_WALLET_RPC_MANAGER.stopInstance((MoneroWalletRpc) walletRpc, save);
MoneroError err = null;
try {
walletRpc.close(save);
} catch (MoneroError e) {
err = e;
}
MONERO_WALLET_RPC_MANAGER.stopInstance((MoneroWalletRpc) walletRpc);
if (err != null) throw err;
}
private void deleteWallet(String walletName) {

View File

@ -19,7 +19,7 @@ package bisq.desktop.components;
import de.jensd.fx.fontawesome.AwesomeDude;
import de.jensd.fx.fontawesome.AwesomeIcon;
import bisq.common.UserThread;
import com.jfoenix.controls.JFXTextField;
import javafx.scene.control.Label;
@ -66,7 +66,9 @@ public class TextFieldWithIcon extends AnchorPane {
}
public void setIcon(AwesomeIcon iconLabel) {
AwesomeDude.setIcon(this.iconLabel, iconLabel);
UserThread.execute(() -> {
AwesomeDude.setIcon(this.iconLabel, iconLabel);
});
}
public void setText(String text) {