various whirlpool-related improvements

This commit is contained in:
Craig Raw 2021-10-04 12:16:03 +02:00
parent ea03dece72
commit 2fa47e640d
5 changed files with 19 additions and 8 deletions

2
drongo

@ -1 +1 @@
Subproject commit 9a9a1b925461ee2a8ae7f6885309b0babd4b6767 Subproject commit e0302cef22a3dd9401f9070318fec5ea15543bd7

View file

@ -912,6 +912,11 @@ public class AppController implements Initializable {
whirlpool.setHDWallet(storage.getWalletId(wallet), copy); whirlpool.setHDWallet(storage.getWalletId(wallet), copy);
} }
StandardAccount standardAccount = wallet.getStandardAccountType();
if(standardAccount != null && standardAccount.getMinimumGapLimit() != null && wallet.gapLimit() == null) {
wallet.setGapLimit(standardAccount.getMinimumGapLimit());
}
for(int i = 0; i < wallet.getKeystores().size(); i++) { for(int i = 0; i < wallet.getKeystores().size(); i++) {
Keystore keystore = wallet.getKeystores().get(i); Keystore keystore = wallet.getKeystores().get(i);
if(keystore.hasSeed()) { if(keystore.hasSeed()) {

View file

@ -66,7 +66,7 @@ public class MixStatusCell extends TreeTableCell<Entry, UtxoEntry.MixStatus> {
if(mixFailReason != MixFailReason.CANCEL) { if(mixFailReason != MixFailReason.CANCEL) {
setGraphic(getFailGlyph()); setGraphic(getFailGlyph());
Tooltip tt = new Tooltip(); Tooltip tt = new Tooltip();
tt.setText(mixFailReason.getMessage() + (mixError == null ? "" : ": " + mixError)); tt.setText(mixFailReason.getMessage() + (mixError == null ? "" : ": " + mixError) + "\nMake sure your internet connection is stable and the computer is configured to prevent sleeping.");
setTooltip(tt); setTooltip(tt);
} else { } else {
setGraphic(null); setGraphic(null);

View file

@ -77,6 +77,8 @@ public class Whirlpool {
private String walletId; private String walletId;
private String mixToWalletId; private String mixToWalletId;
private StartupService startupService;
private final BooleanProperty startingProperty = new SimpleBooleanProperty(false); private final BooleanProperty startingProperty = new SimpleBooleanProperty(false);
private final BooleanProperty stoppingProperty = new SimpleBooleanProperty(false); private final BooleanProperty stoppingProperty = new SimpleBooleanProperty(false);
private final BooleanProperty mixingProperty = new SimpleBooleanProperty(false); private final BooleanProperty mixingProperty = new SimpleBooleanProperty(false);
@ -262,6 +264,15 @@ public class Whirlpool {
httpClientService.shutdown(); httpClientService.shutdown();
} }
public StartupService createStartupService() {
if(startupService != null) {
startupService.cancel();
}
startupService = new StartupService(this);
return startupService;
}
private WalletUtxo getUtxo(WhirlpoolUtxo whirlpoolUtxo) { private WalletUtxo getUtxo(WhirlpoolUtxo whirlpoolUtxo) {
Wallet wallet = AppServices.get().getWallet(walletId); Wallet wallet = AppServices.get().getWallet(walletId);
if(wallet != null) { if(wallet != null) {

View file

@ -29,7 +29,6 @@ public class WhirlpoolServices {
private static final Logger log = LoggerFactory.getLogger(WhirlpoolServices.class); private static final Logger log = LoggerFactory.getLogger(WhirlpoolServices.class);
private final Map<String, Whirlpool> whirlpoolMap = new HashMap<>(); private final Map<String, Whirlpool> whirlpoolMap = new HashMap<>();
private Whirlpool.StartupService startupService;
public Whirlpool getWhirlpool(Wallet wallet) { public Whirlpool getWhirlpool(Wallet wallet) {
Wallet masterWallet = wallet.isMasterWallet() ? wallet : wallet.getMasterWallet(); Wallet masterWallet = wallet.isMasterWallet() ? wallet : wallet.getMasterWallet();
@ -88,11 +87,7 @@ public class WhirlpoolServices {
} }
} }
if(startupService != null) { Whirlpool.StartupService startupService = whirlpool.createStartupService();
startupService.cancel();
}
startupService = new Whirlpool.StartupService(whirlpool);
startupService.setPeriod(Duration.minutes(2)); startupService.setPeriod(Duration.minutes(2));
startupService.setOnSucceeded(workerStateEvent -> { startupService.setOnSucceeded(workerStateEvent -> {
startupService.cancel(); startupService.cancel();