mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
LCL history request and response. (#59)
Detect and request missing lcl history from another random node. Sending lcl history response to a asked node. Getting lcl history response and applying it. Delete lcl that exceeds max ledger sequence.
This commit is contained in:
@@ -151,6 +151,27 @@ std::string get_hash(std::string_view data)
|
||||
return hash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate blake2b hash for a given message.
|
||||
* @param data unsigned char array pointer to hash data.
|
||||
* @param data_length hash data length.
|
||||
* @return The blake2b hash of the pointed buffer.
|
||||
*/
|
||||
std::string get_hash(const unsigned char * data, size_t data_length)
|
||||
{
|
||||
std::string hash;
|
||||
hash.resize(crypto_generichash_blake2b_BYTES);
|
||||
|
||||
crypto_generichash_blake2b(
|
||||
reinterpret_cast<unsigned char *>(hash.data()),
|
||||
hash.length(),
|
||||
data,
|
||||
data_length,
|
||||
NULL, 0);
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates blake2b hash for the given set of strings using stream hashing.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user