mirror of
https://github.com/bisq-network/bisq.git
synced 2025-01-19 05:44:05 +01:00
Use new offerId and fresh data at clone offer
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
parent
d42895637f
commit
13bcfb3121
@ -54,6 +54,7 @@ import com.google.inject.Inject;
|
|||||||
|
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -112,6 +113,7 @@ class CloneOfferDataModel extends MutableOfferDataModel {
|
|||||||
paymentAccounts.clear();
|
paymentAccounts.clear();
|
||||||
paymentAccount = null;
|
paymentAccount = null;
|
||||||
marketPriceMargin = 0;
|
marketPriceMargin = 0;
|
||||||
|
sourceOpenOffer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void applyOpenOffer(OpenOffer openOffer) {
|
public void applyOpenOffer(OpenOffer openOffer) {
|
||||||
@ -202,10 +204,13 @@ class CloneOfferDataModel extends MutableOfferDataModel {
|
|||||||
// We create a new offer based on our source offer and the edited fields in the UI
|
// We create a new offer based on our source offer and the edited fields in the UI
|
||||||
Offer editedOffer = createAndGetOffer();
|
Offer editedOffer = createAndGetOffer();
|
||||||
OfferPayload editedOfferPayload = editedOffer.getOfferPayload().orElseThrow();
|
OfferPayload editedOfferPayload = editedOffer.getOfferPayload().orElseThrow();
|
||||||
// We clone the edited offer but use the maker tx ID from the source offer
|
// We clone the edited offer but use the maker tx ID from the source offer as well as a new offerId and
|
||||||
|
// a fresh date.
|
||||||
String sharedMakerTxId = sourceOfferPayload.getOfferFeePaymentTxId();
|
String sharedMakerTxId = sourceOfferPayload.getOfferFeePaymentTxId();
|
||||||
OfferPayload clonedOfferPayload = new OfferPayload(editedOfferPayload.getId(),
|
String newOfferId = OfferUtil.getRandomOfferId();
|
||||||
editedOfferPayload.getDate(),
|
long date = new Date().getTime();
|
||||||
|
OfferPayload clonedOfferPayload = new OfferPayload(newOfferId,
|
||||||
|
date,
|
||||||
editedOfferPayload.getOwnerNodeAddress(),
|
editedOfferPayload.getOwnerNodeAddress(),
|
||||||
editedOfferPayload.getPubKeyRing(),
|
editedOfferPayload.getPubKeyRing(),
|
||||||
editedOfferPayload.getDirection(),
|
editedOfferPayload.getDirection(),
|
||||||
|
Loading…
Reference in New Issue
Block a user