mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Add sha512Half and SHA512HashHasher:
These routines replace existing code to compute SHA512-Half hashes. The new code accumulates serialized data into a hashing context instead of allocating a buffer, for improved performance.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <ripple/overlay/ClusterNodeStatus.h>
|
||||
#include <ripple/app/misc/UniqueNodeList.h>
|
||||
#include <ripple/app/tx/InboundTransactions.h>
|
||||
#include <ripple/basics/SHA512Half.h>
|
||||
#include <ripple/basics/StringUtilities.h>
|
||||
#include <ripple/basics/UptimeTimer.h>
|
||||
#include <ripple/core/JobQueue.h>
|
||||
@@ -1390,10 +1391,12 @@ PeerImp::onMessage (std::shared_ptr <protocol::TMValidation> const& m)
|
||||
|
||||
try
|
||||
{
|
||||
Serializer s (m->validation ());
|
||||
SerialIter sit (s);
|
||||
STValidation::pointer val = std::make_shared <
|
||||
STValidation> (std::ref (sit), false);
|
||||
STValidation::pointer val;
|
||||
{
|
||||
SerialIter sit (make_Slice(m->validation()));
|
||||
val = std::make_shared <
|
||||
STValidation> (std::ref (sit), false);
|
||||
}
|
||||
|
||||
if (closeTime > (120 + val->getFieldU32(sfSigningTime)))
|
||||
{
|
||||
@@ -1402,8 +1405,8 @@ PeerImp::onMessage (std::shared_ptr <protocol::TMValidation> const& m)
|
||||
return;
|
||||
}
|
||||
|
||||
if (! getApp().getHashRouter ().addSuppressionPeer (
|
||||
s.getSHA512Half(), id_))
|
||||
if (! getApp().getHashRouter ().addSuppressionPeer(
|
||||
sha512Half(make_Slice(m->validation())), id_))
|
||||
{
|
||||
p_journal_.trace << "Validation: duplicate";
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user