mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-12-22 11:39:29 +00:00
stop polling trade wallet after marking shut down started
This commit is contained in:
parent
5294baf949
commit
f6f4fb014e
1 changed files with 2 additions and 2 deletions
|
@ -1132,9 +1132,9 @@ public abstract class Trade implements Tradable, Model {
|
|||
}
|
||||
|
||||
public void onShutDownStarted() {
|
||||
stopPolling();
|
||||
isShutDownStarted = true;
|
||||
if (wallet != null) log.info("{} {} preparing for shut down", getClass().getSimpleName(), getId());
|
||||
stopPolling();
|
||||
|
||||
// repeatedly acquire trade lock to allow other threads to finish
|
||||
for (int i = 0; i < 20; i++) {
|
||||
|
@ -1813,7 +1813,7 @@ public abstract class Trade implements Tradable, Model {
|
|||
|
||||
private void startPolling() {
|
||||
synchronized (walletLock) {
|
||||
if (isPolling()) return;
|
||||
if (isShutDownStarted || isPolling()) return;
|
||||
log.info("Starting to poll wallet for {} {}", getClass().getSimpleName(), getId());
|
||||
txPollLooper = new TaskLooper(() -> pollWallet());
|
||||
txPollLooper.start(walletRefreshPeriod);
|
||||
|
|
Loading…
Reference in a new issue