mirror of
https://github.com/monero-project/monero.git
synced 2025-08-14 08:05:32 -04:00
Make difficulty 128 bit instead of 64 bit
Based on Boolberry work by: jahrsg <jahr@jahr.me> cr.zoidberg <crypto.zoidberg@gmail.com>
This commit is contained in:
parent
e4b049da05
commit
91f4c7f45f
30 changed files with 787 additions and 62 deletions
|
@ -32,12 +32,13 @@
|
|||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
#include <boost/multiprecision/cpp_int.hpp>
|
||||
|
||||
#include "crypto/hash.h"
|
||||
|
||||
namespace cryptonote
|
||||
{
|
||||
typedef std::uint64_t difficulty_type;
|
||||
typedef boost::multiprecision::uint128_t difficulty_type;
|
||||
|
||||
/**
|
||||
* @brief checks if a hash fits the given difficulty
|
||||
|
@ -51,6 +52,10 @@ namespace cryptonote
|
|||
*
|
||||
* @return true if valid, else false
|
||||
*/
|
||||
bool check_hash_64(const crypto::hash &hash, uint64_t difficulty);
|
||||
uint64_t next_difficulty_64(std::vector<std::uint64_t> timestamps, std::vector<uint64_t> cumulative_difficulties, size_t target_seconds);
|
||||
|
||||
bool check_hash_128(const crypto::hash &hash, difficulty_type difficulty);
|
||||
bool check_hash(const crypto::hash &hash, difficulty_type difficulty);
|
||||
difficulty_type next_difficulty(std::vector<std::uint64_t> timestamps, std::vector<difficulty_type> cumulative_difficulties, size_t target_seconds);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue