cannot set trigger price for fixed price offers over api (#1870)

This commit is contained in:
woodser 2025-07-19 08:01:19 -04:00 committed by GitHub
parent 071659aec1
commit dd1fced7fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -519,6 +519,12 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
ErrorMessageHandler errorMessageHandler) { ErrorMessageHandler errorMessageHandler) {
ThreadUtils.execute(() -> { ThreadUtils.execute(() -> {
// cannot set trigger price for fixed price offers
if (triggerPrice != 0 && offer.getOfferPayload().getPrice() != 0) {
errorMessageHandler.handleErrorMessage("Cannot set trigger price for fixed price offers.");
return;
}
// check source offer and clone limit // check source offer and clone limit
OpenOffer sourceOffer = null; OpenOffer sourceOffer = null;
if (sourceOfferId != null) { if (sourceOfferId != null) {
@ -526,7 +532,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
// get source offer // get source offer
Optional<OpenOffer> sourceOfferOptional = getOpenOffer(sourceOfferId); Optional<OpenOffer> sourceOfferOptional = getOpenOffer(sourceOfferId);
if (!sourceOfferOptional.isPresent()) { if (!sourceOfferOptional.isPresent()) {
errorMessageHandler.handleErrorMessage("Source offer not found to clone, offerId=" + sourceOfferId); errorMessageHandler.handleErrorMessage("Source offer not found to clone, offerId=" + sourceOfferId + ".");
return; return;
} }
sourceOffer = sourceOfferOptional.get(); sourceOffer = sourceOfferOptional.get();