Browse Source

remove warmup key derivation, indicate when creating wallet transaction is deriving keys

terminal
Craig Raw 3 years ago
parent
commit
ebbc4289e1
  1. 2
      drongo
  2. 25
      src/main/java/com/sparrowwallet/sparrow/AppServices.java
  3. 9
      src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java

2
drongo

@ -1 +1 @@
Subproject commit d489aa6af9e22e9b707570d9c19ab10aec0d0a28
Subproject commit fefebbabb5202330de028abe05344a91cf602018

25
src/main/java/com/sparrowwallet/sparrow/AppServices.java

@ -1063,13 +1063,6 @@ public class AppServices {
if(Config.get().getServerType() == ServerType.BITCOIN_CORE) {
Platform.runLater(() -> restartBwt(event.getWallet()));
}
//Ensure public key cache is warm
WalletKeyDerivationService walletKeyDerivationService = new WalletKeyDerivationService(event.getWallet());
walletKeyDerivationService.setOnFailed(workerStateEvent -> {
log.error("Error deriving public keys", workerStateEvent.getSource().getException());
});
walletKeyDerivationService.start();
}
@Subscribe
@ -1109,22 +1102,4 @@ public class AppServices {
onlineProperty.set(true);
}
}
private static final class WalletKeyDerivationService extends Service<Boolean> {
private final Wallet wallet;
public WalletKeyDerivationService(Wallet wallet) {
this.wallet = wallet;
}
@Override
protected Task<Boolean> createTask() {
return new Task<>() {
protected Boolean call() {
wallet.copy().derivePublicKeys();
return true;
}
};
}
}
}

9
src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java

@ -599,7 +599,12 @@ public class SendController extends WalletFormController implements Initializabl
final WalletTransactionService currentWalletTransactionService = walletTransactionService;
final KeyFrame delay = new KeyFrame(Duration.millis(200), e -> {
if(currentWalletTransactionService.isRunning()) {
transactionDiagram.update("Selecting UTXOs...");
transactionDiagram.update(currentWalletTransactionService.getMessage());
currentWalletTransactionService.messageProperty().addListener((observable1, oldValue, newValue) -> {
if(currentWalletTransactionService.isRunning()) {
transactionDiagram.update(newValue);
}
});
createButton.setDisable(true);
notificationButton.setDisable(true);
}
@ -677,8 +682,10 @@ public class SendController extends WalletFormController implements Initializabl
protected Task<WalletTransaction> createTask() {
return new Task<>() {
protected WalletTransaction call() throws InsufficientFundsException {
updateMessage("Selecting UTXOs...");
WalletTransaction walletTransaction = wallet.createWalletTransaction(utxoSelectors, utxoFilters, payments, opReturns, excludedChangeNodes,
feeRate, longTermFeeRate, fee, currentBlockHeight, groupByAddress, includeMempoolOutputs, includeSpentMempoolOutputs);
updateMessage("Deriving keys...");
walletTransaction.updateAddressNodeMap(addressNodeMap, walletTransaction.getWallet());
return walletTransaction;
}

Loading…
Cancel
Save