mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-24 23:00:36 -04:00
stricter validation for creating private, no deposit offers
This commit is contained in:
parent
501530d85f
commit
264e5f436e
1 changed files with 5 additions and 3 deletions
|
@ -134,10 +134,12 @@ public class CreateOfferService {
|
||||||
// must nullify empty string so contracts match
|
// must nullify empty string so contracts match
|
||||||
if ("".equals(extraInfo)) extraInfo = null;
|
if ("".equals(extraInfo)) extraInfo = null;
|
||||||
|
|
||||||
// verify buyer as taker security deposit
|
// verify config for private no deposit offers
|
||||||
boolean isBuyerMaker = offerUtil.isBuyOffer(direction);
|
boolean isBuyerMaker = offerUtil.isBuyOffer(direction);
|
||||||
if (!isBuyerMaker && !isPrivateOffer && buyerAsTakerWithoutDeposit) {
|
if (buyerAsTakerWithoutDeposit || isPrivateOffer) {
|
||||||
throw new IllegalArgumentException("Buyer as taker deposit is required for public offers");
|
if (isBuyerMaker) throw new IllegalArgumentException("Buyer must be taker for private offers without deposit");
|
||||||
|
if (!buyerAsTakerWithoutDeposit) throw new IllegalArgumentException("Must set buyer as taker without deposit for private offers");
|
||||||
|
if (!isPrivateOffer) throw new IllegalArgumentException("Must set offer to private for buyer as taker without deposit");
|
||||||
}
|
}
|
||||||
|
|
||||||
// verify fixed price xor market price with margin
|
// verify fixed price xor market price with margin
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue