diff options
author | brunoerg <brunoely.gc@gmail.com> | 2024-05-24 09:25:35 -0300 |
---|---|---|
committer | brunoerg <brunoely.gc@gmail.com> | 2024-08-28 18:21:07 -0300 |
commit | bdad0243be80c4c72f8cefd1233fd7c057a1945b (patch) | |
tree | d5f8af48f84cee302f2efb2eb0c0807229021799 /src/rpc/net.cpp | |
parent | 4ee1940e849efe8fb1510b11d78399231df4b578 (diff) |
rpc, net: getrawaddrman "mapped_as" follow-ups
Diffstat (limited to 'src/rpc/net.cpp')
-rw-r--r-- | src/rpc/net.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 1119a3e668..be9962e458 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -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()); @@ -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) { |