mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-05-17 05:52:19 -04:00
fix contract mismatch by nullifying extra info empty string
This commit is contained in:
parent
6c6c6e2dd5
commit
9b50cd7ba7
1 changed files with 6 additions and 4 deletions
|
@ -130,6 +130,9 @@ public class CreateOfferService {
|
|||
buyerAsTakerWithoutDeposit,
|
||||
extraInfo);
|
||||
|
||||
// must nullify empty string so contracts match
|
||||
if ("".equals(extraInfo)) extraInfo = null;
|
||||
|
||||
// verify buyer as taker security deposit
|
||||
boolean isBuyerMaker = offerUtil.isBuyOffer(direction);
|
||||
if (!isBuyerMaker && !isPrivateOffer && buyerAsTakerWithoutDeposit) {
|
||||
|
@ -142,14 +145,11 @@ public class CreateOfferService {
|
|||
if (marketPriceMargin != 0) throw new IllegalArgumentException("Cannot set market price margin with fixed price");
|
||||
}
|
||||
|
||||
long creationTime = new Date().getTime();
|
||||
NodeAddress makerAddress = p2PService.getAddress();
|
||||
// verify price
|
||||
boolean useMarketBasedPriceValue = fixedPrice == null &&
|
||||
useMarketBasedPrice &&
|
||||
isMarketPriceAvailable(currencyCode) &&
|
||||
!PaymentMethod.isFixedPriceOnly(paymentAccount.getPaymentMethod().getId());
|
||||
|
||||
// verify price
|
||||
if (fixedPrice == null && !useMarketBasedPriceValue) {
|
||||
throw new IllegalArgumentException("Must provide fixed price");
|
||||
}
|
||||
|
@ -166,6 +166,8 @@ public class CreateOfferService {
|
|||
challengeHash = HavenoUtils.getChallengeHash(challenge);
|
||||
}
|
||||
|
||||
long creationTime = new Date().getTime();
|
||||
NodeAddress makerAddress = p2PService.getAddress();
|
||||
long priceAsLong = fixedPrice != null ? fixedPrice.getValue() : 0L;
|
||||
double marketPriceMarginParam = useMarketBasedPriceValue ? marketPriceMargin : 0;
|
||||
long amountAsLong = amount != null ? amount.longValueExact() : 0L;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue