mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Use mNonce256 in SHAMap hashing.
This commit is contained in:
@@ -10,6 +10,20 @@
|
||||
#include "Serializer.h"
|
||||
#include "BitcoinUtil.h"
|
||||
#include "SHAMap.h"
|
||||
#include "Application.h"
|
||||
|
||||
std::size_t hash_SMN::operator() (const SHAMapNode& mn) const
|
||||
{
|
||||
return mn.getDepth()
|
||||
^ *reinterpret_cast<const std::size_t *>(mn.getNodeID().begin())
|
||||
^ *reinterpret_cast<const std::size_t *>(theApp->getNonce256().begin());
|
||||
}
|
||||
|
||||
std::size_t hash_SMN::operator() (const uint256& u) const
|
||||
{
|
||||
return *reinterpret_cast<const std::size_t *>(u.begin())
|
||||
^ *reinterpret_cast<const std::size_t *>(theApp->getNonce256().begin());
|
||||
}
|
||||
|
||||
SHAMap::SHAMap(uint32 seq) : mSeq(seq), mState(Modifying)
|
||||
{
|
||||
|
||||
@@ -77,13 +77,11 @@ public:
|
||||
};
|
||||
|
||||
class hash_SMN
|
||||
{ // These must be randomized for release
|
||||
{
|
||||
public:
|
||||
std::size_t operator() (const SHAMapNode& mn) const
|
||||
{ return mn.getDepth() ^ *reinterpret_cast<const std::size_t *>(mn.getNodeID().begin()); }
|
||||
std::size_t operator() (const SHAMapNode& mn) const;
|
||||
|
||||
std::size_t operator() (const uint256& u) const
|
||||
{ return *reinterpret_cast<const std::size_t *>(u.begin()); }
|
||||
std::size_t operator() (const uint256& u) const;
|
||||
};
|
||||
|
||||
class SHAMapItem
|
||||
|
||||
Reference in New Issue
Block a user