diff --git a/drongo b/drongo index 8e492478..3a061cb7 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit 8e4924783224fc894b45855cdbd866981413db3b +Subproject commit 3a061cb73ae318fcbe7ea1dcb0b670e78803d9fa diff --git a/src/main/java/com/sparrowwallet/sparrow/whirlpool/Whirlpool.java b/src/main/java/com/sparrowwallet/sparrow/whirlpool/Whirlpool.java index 86a2aed6..fd5f6576 100644 --- a/src/main/java/com/sparrowwallet/sparrow/whirlpool/Whirlpool.java +++ b/src/main/java/com/sparrowwallet/sparrow/whirlpool/Whirlpool.java @@ -310,6 +310,17 @@ public class Whirlpool { } } + public void checkIfMixing() { + if(whirlpoolWalletService.whirlpoolWallet() == null) { + return; + } + + if(isMixing() && !whirlpoolWalletService.whirlpoolWallet().isStarted()) { + log.warn("Wallet is not started, but mixingProperty is true"); + WhirlpoolEventService.getInstance().post(new WalletStopEvent(whirlpoolWalletService.whirlpoolWallet())); + } + } + public boolean hasWallet() { return hdWallet != null; } diff --git a/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolServices.java b/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolServices.java index c0c25a99..7b96c181 100644 --- a/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolServices.java +++ b/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolServices.java @@ -182,6 +182,13 @@ public class WhirlpoolServices { stopAllWhirlpool(); } + @Subscribe + public void newBlock(NewBlockEvent event) { + for(Whirlpool whirlpool : whirlpoolMap.values()) { + whirlpool.checkIfMixing(); + } + } + @Subscribe public void walletOpened(WalletOpenedEvent event) { String walletId = event.getStorage().getWalletId(event.getWallet());