mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-01-03 17:40:10 +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() {
|
public void onShutDownStarted() {
|
||||||
stopPolling();
|
|
||||||
isShutDownStarted = true;
|
isShutDownStarted = true;
|
||||||
if (wallet != null) log.info("{} {} preparing for shut down", getClass().getSimpleName(), getId());
|
if (wallet != null) log.info("{} {} preparing for shut down", getClass().getSimpleName(), getId());
|
||||||
|
stopPolling();
|
||||||
|
|
||||||
// repeatedly acquire trade lock to allow other threads to finish
|
// repeatedly acquire trade lock to allow other threads to finish
|
||||||
for (int i = 0; i < 20; i++) {
|
for (int i = 0; i < 20; i++) {
|
||||||
|
@ -1813,7 +1813,7 @@ public abstract class Trade implements Tradable, Model {
|
||||||
|
|
||||||
private void startPolling() {
|
private void startPolling() {
|
||||||
synchronized (walletLock) {
|
synchronized (walletLock) {
|
||||||
if (isPolling()) return;
|
if (isShutDownStarted || isPolling()) return;
|
||||||
log.info("Starting to poll wallet for {} {}", getClass().getSimpleName(), getId());
|
log.info("Starting to poll wallet for {} {}", getClass().getSimpleName(), getId());
|
||||||
txPollLooper = new TaskLooper(() -> pollWallet());
|
txPollLooper = new TaskLooper(() -> pollWallet());
|
||||||
txPollLooper.start(walletRefreshPeriod);
|
txPollLooper.start(walletRefreshPeriod);
|
||||||
|
|
Loading…
Reference in a new issue