update balances off user thread

This commit is contained in:
woodser 2024-01-23 13:41:53 -05:00
parent 40650103d9
commit 29a488d3af

View file

@ -17,6 +17,7 @@
package haveno.core.xmr; package haveno.core.xmr;
import haveno.common.ThreadUtils;
import haveno.common.UserThread; import haveno.common.UserThread;
import haveno.core.offer.OpenOffer; import haveno.core.offer.OpenOffer;
import haveno.core.offer.OpenOfferManager; import haveno.core.offer.OpenOfferManager;
@ -87,6 +88,10 @@ public class Balances {
} }
private void updateBalances() { private void updateBalances() {
ThreadUtils.submitToPool(() -> doUpdateBalances());
}
private void doUpdateBalances() {
// get wallet balances // get wallet balances
BigInteger balance = xmrWalletService.getWallet() == null ? BigInteger.ZERO : xmrWalletService.getWallet().getBalance(0); BigInteger balance = xmrWalletService.getWallet() == null ? BigInteger.ZERO : xmrWalletService.getWallet().getBalance(0);