diff --git a/core/src/main/java/haveno/core/trade/Trade.java b/core/src/main/java/haveno/core/trade/Trade.java index 88d63eb5f0..1bc6470817 100644 --- a/core/src/main/java/haveno/core/trade/Trade.java +++ b/core/src/main/java/haveno/core/trade/Trade.java @@ -841,7 +841,7 @@ public abstract class Trade implements Tradable, Model { public void importMultisigHex() { synchronized (walletLock) { - synchronized (HavenoUtils.getWalletFunctionLock()) { + synchronized (HavenoUtils.getDaemonLock()) { // TODO: lock on daemon because wallet2's import_multisig calls refresh: https://github.com/monero-project/monero/issues/9312 for (int i = 0; i < TradeProtocol.MAX_ATTEMPTS; i++) { try { doImportMultisigHex(); diff --git a/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java b/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java index 2a33a6b84b..7135be02dc 100644 --- a/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java +++ b/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java @@ -383,16 +383,16 @@ public class XmrWalletService { * Sync the given wallet in a thread pool with other wallets. */ public MoneroSyncResult syncWallet(MoneroWallet wallet) { - Callable task = () -> { - synchronized (HavenoUtils.getDaemonLock()) { + synchronized (HavenoUtils.getDaemonLock()) { // TODO: lock defeats purpose of thread pool + Callable task = () -> { return wallet.sync(); + }; + Future future = syncWalletThreadPool.submit(task); + try { + return future.get(); + } catch (Exception e) { + throw new MoneroError(e.getMessage()); } - }; - Future future = syncWalletThreadPool.submit(task); - try { - return future.get(); - } catch (Exception e) { - throw new MoneroError(e.getMessage()); } }