<p></p>
<p><b>@ghubstan</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/5685#discussion_r710060666">core/src/main/java/bisq/core/api/model/PaymentAccountTypeAdapter.java</a>:</p>
<pre style='color:#555'>> +        else if (account.hasPaymentMethodWithId(UPHOLD_ID))
+            return getTradeCurrenciesInList(currencyCodes, getAllUpholdCurrencies());
+        else
+            return Optional.empty();
+    }
+
+    private boolean didReadSelectedTradeCurrencyField(JsonReader in,
+                                                      PaymentAccount account,
+                                                      String fieldName) {
+        if (fieldName.equals("selectedTradeCurrency")) {
+            String fieldValue = nextStringOrNull(in);
+            if (fieldValue != null && !fieldValue.isEmpty()) {
+                Optional<TradeCurrency> tradeCurrency = getTradeCurrency(fieldValue.toUpperCase());
+                if (tradeCurrency.isPresent()) {
+                    account.setSelectedTradeCurrency(tradeCurrency.get());
+                } else {
</pre>
<p>If the json field is not defined, it can't be read.   If it is defined, it is always read.</p>
<p><code>if (fieldName.equals("selectedTradeCurrency")) </code> fails, this method needs to return false so the calling read loop does not  <code>continue</code> to the next json field.</p>
<p>Look at <code>PaymentAccount read(JsonReader in)</code>  [Line 215-254]:</p>
<p>If <code>didReadSelectedTradeCurrencyField()</code> returns false, the <code>currentFieldName</code> might be read in <code>didReadCommonField()</code> or <code>didReadCountryField()</code>.</p>
<p>If <code>didReadSelectedTradeCurrencyField()</code> returns true, the <code>currentFieldName</code> cannot be read in <code>didReadCommonField()</code> or <code>didReadCountryField()</code>.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/5685#discussion_r710060666">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNSHFRV6752L35PHHOLUCHN4NANCNFSM5DQWWXCQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AJFFTNQTEPGROLAQDQR6HTLUCHN4NA5CNFSM5DQWWXC2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOFUJQNCY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/5685#discussion_r710060666",
"url": "https://github.com/bisq-network/bisq/pull/5685#discussion_r710060666",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>