Skip to content

Commit c04fc7b

Browse files
committed
save multisig wallet on same thread in trade wallet operations
1 parent 0ed640b commit c04fc7b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/src/main/java/haveno/core/trade/Trade.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ public MoneroTxWallet createTx(MoneroTxConfig txConfig) {
10511051
synchronized (HavenoUtils.getWalletFunctionLock()) {
10521052
MoneroTxWallet tx = wallet.createTx(txConfig);
10531053
exportMultisigHex();
1054-
requestSaveWallet();
1054+
saveWallet();
10551055
return tx;
10561056
}
10571057
}
@@ -1152,7 +1152,7 @@ private void doImportMultisigHex() {
11521152
throw e;
11531153
}
11541154
}
1155-
requestSaveWallet();
1155+
saveWallet();
11561156
}
11571157
log.info("Done importing multisig hexes for {} {} in {} ms, count={}", getClass().getSimpleName(), getShortId(), System.currentTimeMillis() - startTime, multisigHexes.size());
11581158
}
@@ -1365,6 +1365,7 @@ private void doProcessPayoutTx(String payoutTxHex, boolean sign, boolean publish
13651365
// verify fee is within tolerance by recreating payout tx
13661366
// TODO (monero-project): creating tx will require exchanging updated multisig hex if message needs reprocessed. provide weight with describe_transfer so fee can be estimated?
13671367
log.info("Creating fee estimate tx for {} {}", getClass().getSimpleName(), getId());
1368+
saveWallet(); // save wallet before creating fee estimate tx
13681369
MoneroTxWallet feeEstimateTx = createPayoutTx();
13691370
BigInteger feeEstimate = feeEstimateTx.getFee();
13701371
double feeDiff = payoutTx.getFee().subtract(feeEstimate).abs().doubleValue() / feeEstimate.doubleValue(); // TODO: use BigDecimal?
@@ -1373,6 +1374,7 @@ private void doProcessPayoutTx(String payoutTxHex, boolean sign, boolean publish
13731374
}
13741375

13751376
// save trade state
1377+
saveWallet();
13761378
requestPersistence();
13771379

13781380
// submit payout tx

0 commit comments

Comments
 (0)