Skip to content

Commit

Permalink
Check if makerPaymentMethodId is available falling back to the payloa…
Browse files Browse the repository at this point in the history
…d object if not

This is the case for old dispute cases
  • Loading branch information
ripcurlx committed Jun 28, 2021
1 parent e5765ae commit 3d88f9f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/java/bisq/core/trade/Contract.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

import org.apache.commons.lang3.StringUtils;

import java.util.Objects;
import java.util.Optional;

import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -296,7 +297,8 @@ public byte[] getHashOfPeersPaymentAccountPayload(PubKeyRing myPubKeyRing) {
}

public String getPaymentMethodId() {
return makerPaymentMethodId;
// Either makerPaymentMethodId is set or available in makerPaymentAccountPayload
return makerPaymentMethodId != null ? makerPaymentMethodId : Objects.requireNonNull(makerPaymentAccountPayload).getPaymentMethodId();
}

public Coin getTradeAmount() {
Expand Down

0 comments on commit 3d88f9f

Please sign in to comment.