Browse Source

restrict mixing to mainnet and testnet

terminal
Craig Raw 3 years ago
parent
commit
6bbae204a6
  1. 5
      src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java
  2. 1
      src/main/java/com/sparrowwallet/sparrow/whirlpool/Whirlpool.java

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

@ -140,7 +140,10 @@ public class UtxosController extends WalletFormController implements Initializab
}
private boolean canWalletMix() {
return getWalletForm().getWallet().getKeystores().size() == 1 && getWalletForm().getWallet().getKeystores().get(0).hasSeed() && !getWalletForm().getWallet().isWhirlpoolMixWallet();
return Whirlpool.WHIRLPOOL_NETWORKS.contains(Network.get())
&& getWalletForm().getWallet().getKeystores().size() == 1
&& getWalletForm().getWallet().getKeystores().get(0).hasSeed()
&& !getWalletForm().getWallet().isWhirlpoolMixWallet();
}
private void updateButtons(BitcoinUnit unit) {

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

@ -59,6 +59,7 @@ import java.util.stream.Collectors;
public class Whirlpool {
private static final Logger log = LoggerFactory.getLogger(Whirlpool.class);
public static final List<Network> WHIRLPOOL_NETWORKS = List.of(Network.MAINNET, Network.TESTNET);
public static final int DEFAULT_MIXTO_MIN_MIXES = 5;
public static final int DEFAULT_MIXTO_RANDOM_FACTOR = 4;

Loading…
Cancel
Save