restrict mixing to mainnet and testnet

This commit is contained in:
Craig Raw 2021-09-23 15:30:13 +02:00
parent 0b55dd8a1e
commit 6bbae204a6
2 changed files with 5 additions and 1 deletions

View file

@ -140,7 +140,10 @@ public class UtxosController extends WalletFormController implements Initializab
} }
private boolean canWalletMix() { 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) { private void updateButtons(BitcoinUnit unit) {

View file

@ -59,6 +59,7 @@ import java.util.stream.Collectors;
public class Whirlpool { public class Whirlpool {
private static final Logger log = LoggerFactory.getLogger(Whirlpool.class); 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_MIN_MIXES = 5;
public static final int DEFAULT_MIXTO_RANDOM_FACTOR = 4; public static final int DEFAULT_MIXTO_RANDOM_FACTOR = 4;