Skip to content

Commit

Permalink
Get payment method ID from offerPayload.
Browse files Browse the repository at this point in the history
Was getting an NPE with closed trades older than v1.7.0.
makerPaymentMethodId was new at that point (null for older trades).
makerPaymentAccountPayload can be null for trades where we have
removed account info for privacy reasons (see #6001).
The payment method ID can always be obtained from offerPayload.
  • Loading branch information
jmacxx authored and ripcurlx committed Feb 21, 2022
1 parent 99be324 commit 2bdfa52
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ public byte[] getHashOfPeersPaymentAccountPayload(PubKeyRing myPubKeyRing) {
}

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

public Coin getTradeAmount() {
Expand Down

0 comments on commit 2bdfa52

Please sign in to comment.