Update CMakeLists.txt - play with openssl
[novacoin.git] / src / kernelrecord.h
1 #ifndef KERNELRECORD_H
2 #define KERNELRECORD_H
3
4 #include "uint256.h"
5
6 class CWallet;
7 class CWalletTx;
8
9 class KernelRecord
10 {
11 public:
12     KernelRecord():
13         hash(), nTime(0), address(""), nValue(0), idx(0), spent(false), prevMinutes(0), prevDifficulty(0), prevProbability(0)
14     {
15     }
16
17     KernelRecord(uint256 hash, int64_t nTime):
18             hash(hash), nTime(nTime), address(""), nValue(0), idx(0), spent(false), prevMinutes(0), prevDifficulty(0), prevProbability(0)
19     {
20     }
21
22     KernelRecord(uint256 hash, int64_t nTime, const std::string &address, int64_t nValue, bool spent):
23         hash(hash), nTime(nTime), address(address), nValue(nValue),
24         idx(0), spent(spent), prevMinutes(0), prevDifficulty(0), prevProbability(0)
25     {
26     }
27
28     static bool showTransaction(const CWalletTx &wtx);
29     static std::vector<KernelRecord> decomposeOutput(const CWallet *wallet, const CWalletTx &wtx);
30
31
32     uint256 hash;
33     int64_t nTime;
34     std::string address;
35     int64_t nValue;
36     int idx;
37     bool spent;
38
39     std::string getTxID();
40     int64_t getAge() const;
41     uint64_t getCoinDay() const;
42     double getProbToMintStake(double difficulty, int timeOffset = 0) const;
43     double getProbToMintWithinNMinutes(double difficulty, int minutes);
44     int64_t getPoSReward(int nBits, int timeOffset);
45 protected:
46     int prevMinutes;
47     double prevDifficulty;
48     double prevProbability;
49 };
50
51 #endif // KERNELRECORD_H