mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-09 16:24:53 +00:00
constrain mix from and mix to options to match those supported in the whirlpool client
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.sparrowwallet.sparrow.wallet;
|
||||
|
||||
import com.sparrowwallet.drongo.protocol.ScriptType;
|
||||
import com.sparrowwallet.drongo.wallet.MixConfig;
|
||||
import com.sparrowwallet.drongo.wallet.StandardAccount;
|
||||
import com.sparrowwallet.drongo.wallet.Wallet;
|
||||
@@ -44,6 +45,7 @@ public class MixToController implements Initializable {
|
||||
allWallets.add(NONE_WALLET);
|
||||
|
||||
List<Wallet> destinationWallets = AppServices.get().getOpenWallets().keySet().stream().filter(openWallet -> openWallet.isValid()
|
||||
&& (openWallet.getScriptType() == ScriptType.P2WPKH || openWallet.getScriptType() == ScriptType.P2WSH || openWallet.getScriptType() == ScriptType.P2TR)
|
||||
&& openWallet != wallet && openWallet != wallet.getMasterWallet()
|
||||
&& (openWallet.getStandardAccountType() == null || !StandardAccount.WHIRLPOOL_ACCOUNTS.contains(openWallet.getStandardAccountType()))).collect(Collectors.toList());
|
||||
allWallets.addAll(destinationWallets);
|
||||
|
||||
@@ -137,7 +137,7 @@ public class WhirlpoolServices {
|
||||
&& wallet.getKeystores().get(0).hasSeed()
|
||||
&& wallet.getKeystores().get(0).getSeed().getType() == DeterministicSeed.Type.BIP39
|
||||
&& wallet.getStandardAccountType() != null
|
||||
&& !wallet.isWhirlpoolMixWallet();
|
||||
&& StandardAccount.MIXABLE_ACCOUNTS.contains(wallet.getStandardAccountType());
|
||||
}
|
||||
|
||||
public static void prepareWhirlpoolWallet(Wallet decryptedWallet, String walletId, Storage storage) {
|
||||
|
||||
Reference in New Issue
Block a user