mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-10-05 19:18:26 +00:00
various whirlpool-related improvements
This commit is contained in:
+1
-1
Submodule drongo updated: 9a9a1b9254...e0302cef22
@@ -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()) {
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user