Use Equihash for Proof-of-Work
The main and test networks are configured to use parameters that are currently low-memory but usable with the basic solver; they will be increased once the solver is optimised. The regtest network is configured to have extremely low memory usage for speed. Note that Bitcoin's double-hasher is used for the difficulty check. This does not match the paper, but is simpler than changing the block header serialization. Single hashing is kept for the EquiHash solver because there is no requirement on execution time there, only on memory usage.
This commit is contained in:
@@ -12,12 +12,16 @@
|
||||
|
||||
class CBlockHeader;
|
||||
class CBlockIndex;
|
||||
class CChainParams;
|
||||
class uint256;
|
||||
class arith_uint256;
|
||||
|
||||
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params&);
|
||||
unsigned int CalculateNextWorkRequired(const CBlockIndex* pindexLast, int64_t nFirstBlockTime, const Consensus::Params&);
|
||||
|
||||
/** Check whether the Equihash solution in a block header is valid */
|
||||
bool CheckEquihashSolution(const CBlockHeader *pblock, const CChainParams&);
|
||||
|
||||
/** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */
|
||||
bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params&);
|
||||
arith_uint256 GetBlockProof(const CBlockIndex& block);
|
||||
|
||||
Reference in New Issue
Block a user