diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-07-27 15:46:47 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-07-27 15:46:47 +0100 |
commit | 06aea2cf0a5a86a98fc33516f255373fb7c64c19 (patch) | |
tree | b4b348dea3c722d41a7511fe1290542daf2fada3 /src/p2p/p2p_protocol_defs.h | |
parent | Merge pull request #2159 (diff) | |
download | monero-06aea2cf0a5a86a98fc33516f255373fb7c64c19.tar.xz |
move get_proof_of_trust_hash from util.h to p2p_protocol_defs.h
This avoids having to include p2p_protocol_defs.h in util.h,
as util.h is used a lot, and p2p_protocol_defs.h includes
a lot of other things that most users don't need.
Diffstat (limited to 'src/p2p/p2p_protocol_defs.h')
-rw-r--r-- | src/p2p/p2p_protocol_defs.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/p2p/p2p_protocol_defs.h b/src/p2p/p2p_protocol_defs.h index a471211a6..d8932a1df 100644 --- a/src/p2p/p2p_protocol_defs.h +++ b/src/p2p/p2p_protocol_defs.h @@ -440,6 +440,14 @@ namespace nodetool #endif + inline crypto::hash get_proof_of_trust_hash(const nodetool::proof_of_trust& pot) + { + std::string s; + s.append(reinterpret_cast<const char*>(&pot.peer_id), sizeof(pot.peer_id)); + s.append(reinterpret_cast<const char*>(&pot.time), sizeof(pot.time)); + return crypto::cn_fast_hash(s.data(), s.size()); + } + } |