Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpc: net: follow-ups for #30062 #30183

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
rpc, net: getrawaddrman "mapped_as" follow-ups
  • Loading branch information
brunoerg committed Aug 28, 2024
commit bdad0243be80c4c72f8cefd1233fd7c057a1945b
12 changes: 6 additions & 6 deletions src/rpc/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1102,12 +1102,12 @@ static RPCHelpMan getaddrmaninfo()
};
}

UniValue AddrmanEntryToJSON(const AddrInfo& info, CConnman& connman)
UniValue AddrmanEntryToJSON(const AddrInfo& info, const CConnman& connman)
{
UniValue ret(UniValue::VOBJ);
ret.pushKV("address", info.ToStringAddr());
const auto mapped_as{connman.GetMappedAS(info)};
if (mapped_as != 0) {
const uint32_t mapped_as{connman.GetMappedAS(info)};
if (mapped_as) {
ret.pushKV("mapped_as", mapped_as);
}
ret.pushKV("port", info.GetPort());
Expand All @@ -1116,14 +1116,14 @@ UniValue AddrmanEntryToJSON(const AddrInfo& info, CConnman& connman)
ret.pushKV("network", GetNetworkName(info.GetNetClass()));
ret.pushKV("source", info.source.ToStringAddr());
ret.pushKV("source_network", GetNetworkName(info.source.GetNetClass()));
const auto source_mapped_as{connman.GetMappedAS(info.source)};
if (source_mapped_as != 0) {
const uint32_t source_mapped_as{connman.GetMappedAS(info.source)};
if (source_mapped_as) {
ret.pushKV("source_mapped_as", source_mapped_as);
}
return ret;
}

UniValue AddrmanTableToJSON(const std::vector<std::pair<AddrInfo, AddressPosition>>& tableInfos, CConnman& connman)
UniValue AddrmanTableToJSON(const std::vector<std::pair<AddrInfo, AddressPosition>>& tableInfos, const CConnman& connman)
{
UniValue table(UniValue::VOBJ);
for (const auto& e : tableInfos) {
Expand Down