diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-08-20 21:15:53 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-08-23 13:37:56 +0100 |
commit | 5524bc31510c8116e5e215635307ef973e6abe83 (patch) | |
tree | 19a3d2de03c5d7047aef1ffb734feb9bd35f97d5 /src/p2p/p2p_protocol_defs.h | |
parent | contrib: add sync_info to rlwrap command set (diff) | |
download | monero-5524bc31510c8116e5e215635307ef973e6abe83.tar.xz |
print peer id in 0 padded hex for consistency
Diffstat (limited to '')
-rw-r--r-- | src/p2p/p2p_protocol_defs.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/p2p/p2p_protocol_defs.h b/src/p2p/p2p_protocol_defs.h index f38615def..f2b2cd1da 100644 --- a/src/p2p/p2p_protocol_defs.h +++ b/src/p2p/p2p_protocol_defs.h @@ -44,6 +44,13 @@ namespace nodetool typedef boost::uuids::uuid uuid; typedef uint64_t peerid_type; + static inline std::string peerid_to_string(peerid_type peer_id) + { + std::ostringstream s; + s << std::hex << peer_id; + return epee::string_tools::pad_string(s.str(), 16, '0', true); + } + #pragma pack (push, 1) struct network_address_old |