Publish cloned offer if activated

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
HenrikJannsen 2023-05-05 14:19:31 +07:00
parent 21672a1bd0
commit d42895637f
No known key found for this signature in database
GPG key ID: 02AA2BAE387C8307

View file

@ -417,8 +417,18 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
model,
transaction -> {
OpenOffer openOffer = new OpenOffer(offer, triggerPrice);
if (isSharedMakerFee && cannotActivateOffer(offer)) {
openOffer.setState(OpenOffer.State.DEACTIVATED);
if (isSharedMakerFee) {
if (cannotActivateOffer(offer)) {
openOffer.setState(OpenOffer.State.DEACTIVATED);
} else {
// We did not use the AddToOfferBook task for publishing because we
// do not have created the openOffer during the protocol and we need that to determine if the offer can be activated.
// So in case we have an activated cloned offer we do the publishing here.
model.getOfferBookService().addOffer(model.getOffer(),
() -> model.setOfferAddedToOfferBook(true),
errorMessage -> model.getOffer().setErrorMessage("Could not add offer to offerbook.\n" +
"Please check your network connection and try again."));
}
}
addOpenOfferToList(openOffer);
if (!stopped) {