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