mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-09 16:24:53 +00:00
check if wallet is mixing and restart whirlpool client if necessary
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user