mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-02 20:36:44 +00:00
permit mixing from badbank
This commit is contained in:
parent
63ec856e87
commit
776fcb3044
4 changed files with 11 additions and 9 deletions
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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…
Reference in a new issue