mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-12-17 19:54:35 -05:00
sync main wallet on payout to update pending balance
This commit is contained in:
parent
35be468de0
commit
9eea422c9e
@ -633,10 +633,17 @@ public abstract class Trade implements Tradable, Model {
|
||||
payoutStateSubscription = EasyBind.subscribe(payoutStateProperty, newValue -> {
|
||||
if (isPayoutPublished()) updateWalletRefreshPeriod();
|
||||
|
||||
// cleanup when payout published
|
||||
// handle when payout published
|
||||
if (newValue == Trade.PayoutState.PAYOUT_PUBLISHED) {
|
||||
log.info("Payout published for {} {}", getClass().getSimpleName(), getId());
|
||||
|
||||
// sync main wallet to update pending balance
|
||||
new Thread(() -> {
|
||||
GenUtils.waitFor(1000);
|
||||
if (isShutDownStarted) return;
|
||||
if (Boolean.TRUE.equals(xmrWalletService.getConnectionsService().isConnected())) xmrWalletService.syncWallet(xmrWalletService.getWallet());
|
||||
}).start();
|
||||
|
||||
// complete disputed trade
|
||||
if (getDisputeState().isArbitrated() && !getDisputeState().isClosed()) processModel.getTradeManager().closeDisputedTrade(getId(), Trade.DisputeState.DISPUTE_CLOSED);
|
||||
|
||||
@ -647,7 +654,7 @@ public abstract class Trade implements Tradable, Model {
|
||||
processModel.getXmrWalletService().resetAddressEntriesForTrade(getId());
|
||||
}
|
||||
|
||||
// cleanup when payout unlocks
|
||||
// handle when payout unlocks
|
||||
if (newValue == Trade.PayoutState.PAYOUT_UNLOCKED) {
|
||||
if (!isInitialized) return;
|
||||
log.info("Payout unlocked for {} {}, deleting multisig wallet", getClass().getSimpleName(), getId());
|
||||
|
Loading…
Reference in New Issue
Block a user