Browse Source

permit mixing from badbank

terminal
Craig Raw 3 years ago
parent
commit
776fcb3044
  1. 2
      src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java
  2. 4
      src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java
  3. 13
      src/main/java/com/sparrowwallet/sparrow/whirlpool/Whirlpool.java
  4. 1
      src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolServices.java

2
src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java

@ -224,7 +224,7 @@ public class UtxosController extends WalletFormController implements Initializab
public void mixSelected(ActionEvent event) {
List<UtxoEntry> selectedEntries = getSelectedUtxos();
WhirlpoolDialog whirlpoolDialog = new WhirlpoolDialog(getWalletForm().getWalletId(), getWalletForm().getWallet(), selectedEntries);
WhirlpoolDialog whirlpoolDialog = new WhirlpoolDialog(getWalletForm().getMasterWalletId(), getWalletForm().getWallet(), selectedEntries);
Optional<Tx0Preview> optTx0Preview = whirlpoolDialog.showAndWait();
optTx0Preview.ifPresent(tx0Preview -> previewPremix(tx0Preview, selectedEntries));
}

4
src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java

@ -66,6 +66,10 @@ public class WalletForm {
return wallet.isMasterWallet() ? wallet : wallet.getMasterWallet();
}
public String getMasterWalletId() {
return storage.getWalletId(getMasterWallet());
}
public Storage getStorage() {
return storage;
}

13
src/main/java/com/sparrowwallet/sparrow/whirlpool/Whirlpool.java

@ -52,10 +52,7 @@ import javafx.concurrent.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
public class Whirlpool {
@ -71,9 +68,9 @@ public class Whirlpool {
private final TorClientService torClientService;
private final WhirlpoolWalletService whirlpoolWalletService;
private final WhirlpoolWalletConfig config;
private Tx0ParamService tx0ParamService;
private ExpirablePoolSupplier poolSupplier;
private Tx0Service tx0Service;
private final Tx0ParamService tx0ParamService;
private final ExpirablePoolSupplier poolSupplier;
private final Tx0Service tx0Service;
private HD_Wallet hdWallet;
private String walletId;
private String mixToWalletId;
@ -162,7 +159,7 @@ public class Whirlpool {
HD_WalletFactoryGeneric hdWalletFactory = HD_WalletFactoryGeneric.getInstance();
byte[] seed = hdWalletFactory.computeSeedFromWords(words);
this.walletId = walletId;
hdWallet = new HD_Wallet(purpose, words, config.getNetworkParameters(), seed, passphrase, 1);
hdWallet = new HD_Wallet(purpose, words, config.getNetworkParameters(), seed, passphrase, 10);
} catch(Exception e) {
throw new IllegalStateException("Could not create Whirlpool HD wallet ", e);
}

1
src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolServices.java

@ -136,6 +136,7 @@ public class WhirlpoolServices {
&& wallet.getKeystores().size() == 1
&& wallet.getKeystores().get(0).hasSeed()
&& wallet.getKeystores().get(0).getSeed().getType() == DeterministicSeed.Type.BIP39
&& wallet.getStandardAccountType() != null
&& !wallet.isWhirlpoolMixWallet();
}

Loading…
Cancel
Save