#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <limits>
#include "misc_log_ex.h"
#include "crypto/hash.h"
#include "cryptonote_basic/difficulty.h"
Go to the source code of this file.
|
| int | main (int argc, char *argv[]) |
| |
◆ main()
| int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 43 of file hash-target.cpp.
49 if (
check_hash(h, diff) != (b == 0 || diff <= 255 / b)) {
54 ((
char *) &h)[31] = b;
55 if (
check_hash(h, diff) != (diff <= 255 / b)) {
60 if (diff < numeric_limits<uint64_t>::max() / 256) {
62 for (
int i = 31; i >= 0; i--) {
63 val = val * 256 + 255;
64 ((
char *) &h)[i] =
static_cast<char>(
static_cast<uint64_t>(val / diff));
65 val %= (diff & 0xffffffffffffffff).convert_to<uint64_t>();
71 for (
int i = 0;; i++) {
75 if (++((
char *) &h)[i] != 0) {
84 if (diff + 1 + (diff >> 8) < diff) {
bool check_hash(const crypto::hash &hash, difficulty_type difficulty)
unsigned __int64 uint64_t
boost::multiprecision::uint128_t difficulty_type
#define CATCH_ENTRY_L0(lacation, return_val)