import multisig hex locks on daemon due to refresh call

This commit is contained in:
woodser 2024-04-29 11:15:34 -04:00
parent bd1be1041a
commit 8e24ebfc23
2 changed files with 9 additions and 9 deletions

View File

@ -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();

View File

@ -383,10 +383,9 @@ public class XmrWalletService {
* Sync the given wallet in a thread pool with other wallets.
*/
public MoneroSyncResult syncWallet(MoneroWallet wallet) {
synchronized (HavenoUtils.getDaemonLock()) { // TODO: lock defeats purpose of thread pool
Callable<MoneroSyncResult> task = () -> {
synchronized (HavenoUtils.getDaemonLock()) {
return wallet.sync();
}
};
Future<MoneroSyncResult> future = syncWalletThreadPool.submit(task);
try {
@ -395,6 +394,7 @@ public class XmrWalletService {
throw new MoneroError(e.getMessage());
}
}
}
public void saveWallet(MoneroWallet wallet) {
saveWallet(wallet, false);