always use master wallet for testing if payment was sent to child, add postmix check

This commit is contained in:
Craig Raw 2023-10-11 11:41:43 +02:00
parent 74d2bfec24
commit 30aff11908

View file

@ -129,13 +129,18 @@ public class WalletTransaction {
return isWalletSend(StandardAccount.WHIRLPOOL_PREMIX, payment); return isWalletSend(StandardAccount.WHIRLPOOL_PREMIX, payment);
} }
public boolean isPostmixSend(Payment payment) {
return isWalletSend(StandardAccount.WHIRLPOOL_POSTMIX, payment);
}
public boolean isBadbankSend(Payment payment) { public boolean isBadbankSend(Payment payment) {
return isWalletSend(StandardAccount.WHIRLPOOL_BADBANK, payment); return isWalletSend(StandardAccount.WHIRLPOOL_BADBANK, payment);
} }
private boolean isWalletSend(StandardAccount childAccount, Payment payment) { private boolean isWalletSend(StandardAccount childAccount, Payment payment) {
if(getWallet() != null) { if(getWallet() != null) {
return isWalletSend(getWallet().getChildWallet(childAccount), payment); Wallet masterWallet = getWallet().isMasterWallet() ? getWallet() : getWallet().getMasterWallet();
return isWalletSend(masterWallet.getChildWallet(childAccount), payment);
} }
return false; return false;