doxygen documentation for difficulty functions

This commit is contained in:
Thomas Winget 2015-10-07 22:28:43 -04:00
parent 540a76c5c2
commit 8ac329df02
No known key found for this signature in database
GPG key ID: 58131A160789E630
2 changed files with 16 additions and 2 deletions

View file

@ -39,6 +39,18 @@ namespace cryptonote
{
typedef std::uint64_t difficulty_type;
/**
* @brief checks if a hash fits the given difficulty
*
* The hash passes if (hash * difficulty) < 2^192.
* Phrased differently, if (hash * difficulty) fits without overflow into
* the least significant 192 bits of the 256 bit multiplication result.
*
* @param hash the hash to check
* @param difficulty the difficulty to check against
*
* @return true if valid, else false
*/
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);
}