From 82445c0e2816022155cb235577550e08baa3c295 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Fri, 4 Dec 2020 12:40:30 -0500 Subject: [PATCH] In case the peers witness is not found and the trade amount is not exceeding TOLERATED_SMALL_TRADE_AMOUNT (0.01 BTC) we return true for verifyPeersTradeAmount. Before such offers could not be taken even the witness check would be irrelevant as the trade amount is below the threshold where we require account age witness. --- .../core/account/witness/AccountAgeWitnessService.java | 10 +++++++++- 1 file changed, 9 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 659cd0d0f02..7d655115bc6 100644 --- a/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java +++ b/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java @@ -533,11 +533,19 @@ public boolean verifyPeersTradeAmount(Offer offer, Coin tradeAmount, ErrorMessageHandler errorMessageHandler) { checkNotNull(offer); + + // In case we don't find the witness we check if the trade amount is above the + // TOLERATED_SMALL_TRADE_AMOUNT (0.01 BTC) and only in that case return false. return findWitness(offer) .map(witness -> verifyPeersTradeLimit(offer, tradeAmount, witness, new Date(), errorMessageHandler)) - .orElse(false); + .orElse(isToleratedSmalleAmount(tradeAmount)); } + private boolean isToleratedSmalleAmount(Coin tradeAmount) { + return tradeAmount.value <= OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT.value; + } + + /////////////////////////////////////////////////////////////////////////////////////////// // Package scope verification subroutines ///////////////////////////////////////////////////////////////////////////////////////////