Skip to content

Commit 96486e8

Browse files
committed
f'HF: Move block.proof.challenge to Consensus::Params::signblockscript'
1 parent d7b0ed4 commit 96486e8

File tree

5 files changed

+0
-23
lines changed

5 files changed

+0
-23
lines changed

src/miner.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParam
6666
if (nOldTime < nNewTime)
6767
pblock->nTime = nNewTime;
6868

69-
// Updating time can change work required on testnet:
70-
if (consensusParams.fPowAllowMinDifficultyBlocks)
71-
ResetChallenge(*pblock, *pindexPrev, consensusParams);
72-
7369
return nNewTime - nOldTime;
7470
}
7571

@@ -146,7 +142,6 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
146142
// Reset proof here, for weight calculations since header
147143
// is not fixed size.
148144
ResetProof(*pblock);
149-
ResetChallenge(*pblock, *pindexPrev, chainparams.GetConsensus());
150145

151146
// Pad weight for challenge
152147
// We won't bother with serialization byte(s), we have room

src/pow.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,6 @@ CScript CombineBlockSignatures(const Consensus::Params& params, const CBlockHead
2828
return GenericCombineSignatures(params.signblockscript, header, sig1, sig2).scriptSig;
2929
}
3030

31-
bool CheckChallenge(const CBlockHeader& block, const CBlockIndex& indexLast, const Consensus::Params& params)
32-
{
33-
return true;
34-
}
35-
36-
void ResetChallenge(CBlockHeader& block, const CBlockIndex& indexLast, const Consensus::Params& params)
37-
{
38-
}
39-
4031
bool CheckBitcoinProof(uint256 hash, unsigned int nBits)
4132
{
4233
bool fNegative;

src/pow.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ bool CheckProof(const CBlockHeader& block, const Consensus::Params&);
2525
/** Scans nonces looking for a hash with at least some zero bits */
2626
bool MaybeGenerateProof(const Consensus::Params& params, CBlockHeader* pblock, CWallet* pwallet);
2727
void ResetProof(CBlockHeader& block);
28-
bool CheckChallenge(const CBlockHeader& block, const CBlockIndex& indexLast, const Consensus::Params&);
29-
void ResetChallenge(CBlockHeader& block, const CBlockIndex& indexLast, const Consensus::Params&);
30-
3128
CScript CombineBlockSignatures(const Consensus::Params& params, const CBlockHeader& header, const CScript& scriptSig1, const CScript& scriptSig2);
3229

3330
#endif // BITCOIN_POW_H

src/rpc/blockchain.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "consensus/validation.h"
1212
#include "core_io.h"
1313
#include "validation.h"
14-
#include "core_io.h"
1514
#include "policy/policy.h"
1615
#include "primitives/transaction.h"
1716
#include "rpc/server.h"

src/validation.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3898,11 +3898,6 @@ std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBloc
38983898

38993899
bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev, int64_t nAdjustedTime)
39003900
{
3901-
const int nHeight = pindexPrev == NULL ? 0 : pindexPrev->nHeight + 1;
3902-
// Check proof of work
3903-
if (!CheckChallenge(block, *pindexPrev, consensusParams))
3904-
return state.DoS(100, false, REJECT_INVALID, "bad-diffbits", false, "incorrect proof of work");
3905-
39063901
// Check timestamp against prev
39073902
if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast())
39083903
return state.Invalid(false, REJECT_INVALID, "time-too-old", "block's timestamp is too early");

0 commit comments

Comments
 (0)