From 4ebf0f75385598f4211af67ab0c32441d9550e39 Mon Sep 17 00:00:00 2001 From: woodser Date: Fri, 28 Apr 2023 07:20:28 -0400 Subject: [PATCH] ignore payment sent nack if not seller, add logging --- .../haveno/core/offer/OfferFilterService.java | 7 +++++++ .../arbitration/ArbitrationManager.java | 2 +- .../main/java/haveno/core/trade/Trade.java | 14 ++++++++----- .../core/trade/protocol/TradeProtocol.java | 20 +++++++++++-------- .../SellerPreparePaymentReceivedMessage.java | 2 +- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/haveno/core/offer/OfferFilterService.java b/core/src/main/java/haveno/core/offer/OfferFilterService.java index 6ce87ff6..f47d3ad5 100644 --- a/core/src/main/java/haveno/core/offer/OfferFilterService.java +++ b/core/src/main/java/haveno/core/offer/OfferFilterService.java @@ -26,6 +26,7 @@ import haveno.core.support.dispute.arbitration.arbitrator.Arbitrator; import haveno.core.trade.HavenoUtils; import haveno.core.user.Preferences; import haveno.core.user.User; +import haveno.network.p2p.NodeAddress; import javafx.collections.SetChangeListener; import lombok.Getter; import lombok.extern.slf4j.Slf4j; @@ -34,8 +35,10 @@ import org.bitcoinj.core.Coin; import javax.inject.Inject; import javax.inject.Singleton; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.stream.Collectors; @Slf4j @Singleton @@ -217,6 +220,10 @@ public class OfferFilterService { public boolean hasValidArbitrator(Offer offer) { Arbitrator arbitrator = user.getAcceptedArbitratorByAddress(offer.getOfferPayload().getArbitratorSigner()); + if (arbitrator == null) { + List arbitratorAddresses = user.getAcceptedArbitrators().stream().map(Arbitrator::getNodeAddress).collect(Collectors.toList()); + log.warn("No arbitrator registered with offer's signer. offerId={}. Accepted arbitrators={}", offer.getOfferPayload().getArbitratorSigner(), arbitratorAddresses); + } return arbitrator != null; } diff --git a/core/src/main/java/haveno/core/support/dispute/arbitration/ArbitrationManager.java b/core/src/main/java/haveno/core/support/dispute/arbitration/ArbitrationManager.java index e618ef1c..f3b90687 100644 --- a/core/src/main/java/haveno/core/support/dispute/arbitration/ArbitrationManager.java +++ b/core/src/main/java/haveno/core/support/dispute/arbitration/ArbitrationManager.java @@ -400,7 +400,7 @@ public final class ArbitrationManager extends DisputeManager