mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Refactor proof of work related functions out of main
This commit is contained in:
10
src/main.h
10
src/main.h
@@ -146,10 +146,6 @@ bool ProcessMessages(CNode* pfrom);
|
||||
bool SendMessages(CNode* pto, bool fSendTrickle);
|
||||
/** Run an instance of the script checking thread */
|
||||
void ThreadScriptCheck();
|
||||
/** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */
|
||||
bool CheckProofOfWork(uint256 hash, unsigned int nBits);
|
||||
/** Calculate the minimum amount of work a received block needs, without knowing its direct parent */
|
||||
unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime);
|
||||
/** Check whether we are doing an initial block download (synchronizing from disk or network) */
|
||||
bool IsInitialBlockDownload();
|
||||
/** Format a string that describes several potential problems detected by the core */
|
||||
@@ -159,7 +155,6 @@ bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock, b
|
||||
/** Find the best known block, and make it the tip of the block chain */
|
||||
bool ActivateBestChain(CValidationState &state);
|
||||
int64_t GetBlockValue(int nHeight, int64_t nFees);
|
||||
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock);
|
||||
|
||||
void UpdateTime(CBlockHeader& block, const CBlockIndex* pindexPrev);
|
||||
|
||||
@@ -812,11 +807,6 @@ public:
|
||||
return (~bnTarget / (bnTarget + 1)) + 1;
|
||||
}
|
||||
|
||||
bool CheckIndex() const
|
||||
{
|
||||
return CheckProofOfWork(GetBlockHash(), nBits);
|
||||
}
|
||||
|
||||
enum { nMedianTimeSpan=11 };
|
||||
|
||||
int64_t GetMedianTimePast() const
|
||||
|
||||
Reference in New Issue
Block a user