1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-15 04:32:21 +00:00
ton/crypto/util/Miner.h

24 lines
564 B
C
Raw Normal View History

2020-07-06 14:07:20 +00:00
#pragma once
#include "block/block.h"
#include "td/utils/optional.h"
#include "td/utils/Time.h"
#include <atomic>
#include <array>
namespace ton {
class Miner {
public:
struct Options {
block::StdAddress my_address;
std::array<td::uint8, 16> seed;
std::array<td::uint8, 32> complexity;
td::optional<td::Timestamp> expire_at;
td::int64 max_iterations = std::numeric_limits<td::int64>::max();
std::atomic<td::uint64>* hashes_computed{nullptr};
};
static td::optional<std::string> run(const Options& options);
};
} // namespace ton