mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-12-25 15:29:23 -05:00
import multisig hex locks on daemon due to refresh call
This commit is contained in:
parent
bd1be1041a
commit
8e24ebfc23
@ -841,7 +841,7 @@ public abstract class Trade implements Tradable, Model {
|
|||||||
|
|
||||||
public void importMultisigHex() {
|
public void importMultisigHex() {
|
||||||
synchronized (walletLock) {
|
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++) {
|
for (int i = 0; i < TradeProtocol.MAX_ATTEMPTS; i++) {
|
||||||
try {
|
try {
|
||||||
doImportMultisigHex();
|
doImportMultisigHex();
|
||||||
|
@ -383,16 +383,16 @@ public class XmrWalletService {
|
|||||||
* Sync the given wallet in a thread pool with other wallets.
|
* Sync the given wallet in a thread pool with other wallets.
|
||||||
*/
|
*/
|
||||||
public MoneroSyncResult syncWallet(MoneroWallet wallet) {
|
public MoneroSyncResult syncWallet(MoneroWallet wallet) {
|
||||||
Callable<MoneroSyncResult> task = () -> {
|
synchronized (HavenoUtils.getDaemonLock()) { // TODO: lock defeats purpose of thread pool
|
||||||
synchronized (HavenoUtils.getDaemonLock()) {
|
Callable<MoneroSyncResult> task = () -> {
|
||||||
return wallet.sync();
|
return wallet.sync();
|
||||||
|
};
|
||||||
|
Future<MoneroSyncResult> future = syncWalletThreadPool.submit(task);
|
||||||
|
try {
|
||||||
|
return future.get();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new MoneroError(e.getMessage());
|
||||||
}
|
}
|
||||||
};
|
|
||||||
Future<MoneroSyncResult> future = syncWalletThreadPool.submit(task);
|
|
||||||
try {
|
|
||||||
return future.get();
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new MoneroError(e.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user