Fabcoin Core  0.16.2
P2P Digital Currency
pow.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2017 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef FABCOIN_POW_H
7 #define FABCOIN_POW_H
8 
9 #include <consensus/params.h>
10 #include <arith_uint256.h>
11 #include <stdint.h>
12 
13 class CBlockHeader;
14 class CBlockIndex;
15 class CChainParams;
16 class uint256;
17 
18 unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params&);
19 unsigned int CalculateNextWorkRequired(arith_uint256 bnAvg, int64_t nLastBlockTime, int64_t nFirstBlockTime, const Consensus::Params& params);
20 
22 unsigned int LwmaGetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params&);
23 unsigned int LwmaCalculateNextWorkRequired(const CBlockIndex* pindexLast, const Consensus::Params& params);
24 
26 unsigned int DigishieldGetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params&);
27 unsigned int DigishieldCalculateNextWorkRequired(const CBlockIndex* pindexLast, arith_uint256 bnAvg, int64_t nLastBlockTime, int64_t nFirstBlockTime, const Consensus::Params& params);
28 
30 unsigned int ReduceDifficultyBy(const CBlockIndex* pindexLast, int64_t multiplier, const Consensus::Params& params);
31 
33 bool CheckEquihashSolution(const CBlockHeader *pblock, const CChainParams&);
34 
36 bool CheckProofOfWork(uint256 hash, unsigned int nBits, bool postfork, const Consensus::Params&);
37 
38 #endif // FABCOIN_POW_H
unsigned int CalculateNextWorkRequired(arith_uint256 bnAvg, int64_t nLastBlockTime, int64_t nFirstBlockTime, const Consensus::Params &params)
unsigned int GetNextWorkRequired(const CBlockIndex *pindexLast, const CBlockHeader *pblock, const Consensus::Params &)
Definition: pow.cpp:18
bool CheckEquihashSolution(const CBlockHeader *pblock, const CChainParams &)
Check whether the Equihash solution in a block header is valid.
Definition: pow.cpp:258
CChainParams defines various tweakable parameters of a given instance of the Fabcoin system...
Definition: chainparams.h:47
unsigned int DigishieldCalculateNextWorkRequired(const CBlockIndex *pindexLast, arith_uint256 bnAvg, int64_t nLastBlockTime, int64_t nFirstBlockTime, const Consensus::Params &params)
Definition: pow.cpp:218
unsigned int ReduceDifficultyBy(const CBlockIndex *pindexLast, int64_t multiplier, const Consensus::Params &params)
Reduce the difficulty by a given multiplier.
Definition: pow.cpp:242
bool CheckProofOfWork(uint256 hash, unsigned int nBits, bool postfork, const Consensus::Params &)
Check whether a block hash satisfies the proof-of-work requirement specified by nBits.
Definition: pow.cpp:290
unsigned int LwmaCalculateNextWorkRequired(const CBlockIndex *pindexLast, const Consensus::Params &params)
Definition: pow.cpp:96
Parameters that influence chain consensus.
Definition: params.h:39
256-bit unsigned big integer.
unsigned int DigishieldGetNextWorkRequired(const CBlockIndex *pindexLast, const CBlockHeader *pblock, const Consensus::Params &)
Digishield v3 - used in Fabcoin mainnet currently.
Definition: pow.cpp:193
256-bit opaque blob.
Definition: uint256.h:132
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: chain.h:177
Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce value...
Definition: block.h:35
unsigned int LwmaGetNextWorkRequired(const CBlockIndex *pindexLast, const CBlockHeader *pblock, const Consensus::Params &)
Zawy&#39;s LWMA - next generation algorithm.
Definition: pow.cpp:64