mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-12-23 03:58:52 +00:00
Merge pull request #2215
06aea2cf
move get_proof_of_trust_hash from util.h to p2p_protocol_defs.h (moneromooo-monero)
This commit is contained in:
commit
a6ea26e7fa
@ -40,7 +40,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "crypto/hash.h"
|
#include "crypto/hash.h"
|
||||||
#include "p2p/p2p_protocol_defs.h"
|
|
||||||
|
|
||||||
/*! \brief Various Tools
|
/*! \brief Various Tools
|
||||||
*
|
*
|
||||||
@ -108,14 +107,6 @@ namespace tools
|
|||||||
|
|
||||||
bool sanitize_locale();
|
bool sanitize_locale();
|
||||||
|
|
||||||
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());
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! \brief Defines a signal handler for win32 and *nix
|
/*! \brief Defines a signal handler for win32 and *nix
|
||||||
*/
|
*/
|
||||||
class signal_handler
|
class signal_handler
|
||||||
|
@ -1382,7 +1382,7 @@ namespace nodetool
|
|||||||
}
|
}
|
||||||
crypto::public_key pk = AUTO_VAL_INIT(pk);
|
crypto::public_key pk = AUTO_VAL_INIT(pk);
|
||||||
epee::string_tools::hex_to_pod(::config::P2P_REMOTE_DEBUG_TRUSTED_PUB_KEY, pk);
|
epee::string_tools::hex_to_pod(::config::P2P_REMOTE_DEBUG_TRUSTED_PUB_KEY, pk);
|
||||||
crypto::hash h = tools::get_proof_of_trust_hash(tr);
|
crypto::hash h = get_proof_of_trust_hash(tr);
|
||||||
if(!crypto::check_signature(h, pk, tr.sign))
|
if(!crypto::check_signature(h, pk, tr.sign))
|
||||||
{
|
{
|
||||||
LOG_ERROR("check_trust failed: sign check failed");
|
LOG_ERROR("check_trust failed: sign check failed");
|
||||||
|
@ -440,6 +440,14 @@ namespace nodetool
|
|||||||
#endif
|
#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());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user