Merge pull request #356 from svost/c++11
[novacoin.git] / src / kernel_worker.h
1 #ifndef NOVACOIN_KERNELWORKER_H
2 #define NOVACOIN_KERNELWORKER_H
3
4 #include <vector>
5
6
7 class KernelWorker
8 {
9 public:
10     KernelWorker()
11     { }
12     KernelWorker(uint8_t *kernel, uint32_t nBits, uint32_t nInputTxTime, int64_t nValueIn, uint32_t nIntervalBegin, uint32_t nIntervalEnd);
13     void Do();
14     std::vector<std::pair<uint256,uint32_t> >& GetSolutions();
15
16 private:
17     // One way hashing.
18     void Do_generic();
19
20     // Kernel solutions.
21     std::vector<std::pair<uint256,uint32_t> > solutions;
22
23     // Kernel metadata.
24     uint8_t *kernel = nullptr;
25     uint32_t nBits = 0;
26     uint32_t nInputTxTime = 0;
27     CBigNum  bnValueIn = 0;
28
29     // Interval boundaries.
30     uint32_t nIntervalBegin = 0;
31     uint32_t nIntervalEnd = 0;
32 };
33
34 // Scan given kernel for solutions
35 bool ScanKernelBackward(uint8_t *kernel, uint32_t nBits, uint32_t nInputTxTime, int64_t nValueIn, std::pair<uint32_t, uint32_t> &SearchInterval, std::pair<uint256, uint32_t> &solution);
36
37 #endif // NOVACOIN_KERNELWORKER_H