Skip to content

Commit

Permalink
getfeeexchangerates: use asset labels rather than hexes when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
JBetz committed Apr 12, 2024
1 parent 8929a05 commit 6c5b8de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rpc/exchangerates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ static RPCHelpMan getfeeexchangerates()
{
UniValue response = UniValue{UniValue::VOBJ};
for (auto rate : ExchangeRateMap::GetInstance()) {
response.pushKV(rate.first.GetHex(), rate.second.m_scaled_value);
std::string label = gAssetsDir.GetLabel(rate.first);
if (label == "") {
label = rate.first.GetHex();
}
response.pushKV(label, rate.second.m_scaled_value);
}
return response;
},
Expand Down

0 comments on commit 6c5b8de

Please sign in to comment.