Skip to content

Commit

Permalink
Merge pull request bisq-network#4897 from chimp1984/dont-require-acco…
Browse files Browse the repository at this point in the history
…unt-witness-for-small-amounts

Allow take offer in case account age witness is not found and trade amount is small
  • Loading branch information
ripcurlx authored Dec 6, 2020
2 parents 9e3968e + 82445c0 commit 6d01bc9
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
///////////////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 6d01bc9

Please sign in to comment.