From 1f22f89bb4f6a8f9089de8502d91a9cf35e9aeb1 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Tue, 18 Jan 2022 11:29:41 +0100 Subject: [PATCH 1/2] Not create and publish account age witnesses for BSQ swap accounts --- .../bisq/core/account/witness/AccountAgeWitnessService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java b/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java index 925b227d0e9..effe20f5fd9 100644 --- a/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java +++ b/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java @@ -26,6 +26,7 @@ import bisq.core.offer.OfferDirection; import bisq.core.offer.OfferRestrictions; import bisq.core.payment.AssetAccount; +import bisq.core.payment.BsqSwapAccount; import bisq.core.payment.ChargeBackRisk; import bisq.core.payment.PaymentAccount; import bisq.core.payment.payload.PaymentAccountPayload; @@ -228,7 +229,7 @@ private void onBootStrapped() { private void republishAllFiatAccounts() { if (user.getPaymentAccounts() != null) user.getPaymentAccounts().stream() - .filter(account -> !(account instanceof AssetAccount)) + .filter(account -> !(account instanceof AssetAccount) && !(account instanceof BsqSwapAccount)) .forEach(account -> { AccountAgeWitness myWitness = getMyWitness(account.getPaymentAccountPayload()); // We only publish if the date of our witness is inside the date tolerance. From 5e158e83003816469b516d1fc2afebe653957334 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Wed, 19 Jan 2022 16:55:09 +0100 Subject: [PATCH 2/2] Use isFiat method for checking if it is a fiat method --- .../bisq/core/account/witness/AccountAgeWitnessService.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java b/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java index effe20f5fd9..c0d2978ab65 100644 --- a/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java +++ b/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java @@ -25,8 +25,6 @@ import bisq.core.offer.Offer; import bisq.core.offer.OfferDirection; import bisq.core.offer.OfferRestrictions; -import bisq.core.payment.AssetAccount; -import bisq.core.payment.BsqSwapAccount; import bisq.core.payment.ChargeBackRisk; import bisq.core.payment.PaymentAccount; import bisq.core.payment.payload.PaymentAccountPayload; @@ -229,7 +227,7 @@ private void onBootStrapped() { private void republishAllFiatAccounts() { if (user.getPaymentAccounts() != null) user.getPaymentAccounts().stream() - .filter(account -> !(account instanceof AssetAccount) && !(account instanceof BsqSwapAccount)) + .filter(account -> account.getPaymentMethod().isFiat()) .forEach(account -> { AccountAgeWitness myWitness = getMyWitness(account.getPaymentAccountPayload()); // We only publish if the date of our witness is inside the date tolerance.