mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Merge #9273: Remove unused CDiskBlockPos* argument from ProcessNewBlock
a13fa4c
Remove unused CDiskBlockPos* argument from ProcessNewBlock (Matt Corallo)
This commit is contained in:
parent
e6d05d71dd
commit
e34afa1067
@ -2011,7 +2011,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||
mapBlockSource.emplace(hash, pfrom->GetId());
|
||||
}
|
||||
bool fNewBlock = false;
|
||||
ProcessNewBlock(chainparams, pblock, forceProcessing, NULL, &fNewBlock);
|
||||
ProcessNewBlock(chainparams, pblock, forceProcessing, &fNewBlock);
|
||||
if (fNewBlock)
|
||||
pfrom->nLastBlockTime = GetTime();
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ UniValue generateBlocks(boost::shared_ptr<CReserveScript> coinbaseScript, int nG
|
||||
continue;
|
||||
}
|
||||
std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(*pblock);
|
||||
if (!ProcessNewBlock(Params(), shared_pblock, true, NULL, NULL))
|
||||
if (!ProcessNewBlock(Params(), shared_pblock, true, NULL))
|
||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "ProcessNewBlock, block not accepted");
|
||||
++nHeight;
|
||||
blockHashes.push_back(pblock->GetHash().GetHex());
|
||||
@ -795,7 +795,7 @@ UniValue submitblock(const JSONRPCRequest& request)
|
||||
|
||||
submitblock_StateCatcher sc(block.GetHash());
|
||||
RegisterValidationInterface(&sc);
|
||||
bool fAccepted = ProcessNewBlock(Params(), blockptr, true, NULL, NULL);
|
||||
bool fAccepted = ProcessNewBlock(Params(), blockptr, true, NULL);
|
||||
UnregisterValidationInterface(&sc);
|
||||
if (fBlockPresent)
|
||||
{
|
||||
|
@ -229,7 +229,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
|
||||
pblock->hashMerkleRoot = BlockMerkleRoot(*pblock);
|
||||
pblock->nNonce = blockinfo[i].nonce;
|
||||
std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(*pblock);
|
||||
BOOST_CHECK(ProcessNewBlock(chainparams, shared_pblock, true, NULL, NULL));
|
||||
BOOST_CHECK(ProcessNewBlock(chainparams, shared_pblock, true, NULL));
|
||||
pblock->hashPrevBlock = pblock->GetHash();
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>&
|
||||
while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce;
|
||||
|
||||
std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(block);
|
||||
ProcessNewBlock(chainparams, shared_pblock, true, NULL, NULL);
|
||||
ProcessNewBlock(chainparams, shared_pblock, true, NULL);
|
||||
|
||||
CBlock result = block;
|
||||
return result;
|
||||
|
@ -3549,7 +3549,7 @@ static bool IsSuperMajority(int minVersion, const CBlockIndex* pstart, unsigned
|
||||
}
|
||||
|
||||
|
||||
bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, const CDiskBlockPos* dbp, bool *fNewBlock)
|
||||
bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, bool *fNewBlock)
|
||||
{
|
||||
{
|
||||
LOCK(cs_main);
|
||||
@ -3558,7 +3558,7 @@ bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<cons
|
||||
CBlockIndex *pindex = NULL;
|
||||
if (fNewBlock) *fNewBlock = false;
|
||||
CValidationState state;
|
||||
bool ret = AcceptBlock(*pblock, state, chainparams, &pindex, fForceProcessing, dbp, fNewBlock);
|
||||
bool ret = AcceptBlock(*pblock, state, chainparams, &pindex, fForceProcessing, NULL, fNewBlock);
|
||||
CheckBlockIndex(chainparams.GetConsensus());
|
||||
if (!ret) {
|
||||
GetMainSignals().BlockChecked(*pblock, state);
|
||||
|
@ -238,11 +238,10 @@ static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 945 * 1024 * 1024;
|
||||
*
|
||||
* @param[in] pblock The block we want to process.
|
||||
* @param[in] fForceProcessing Process this block even if unrequested; used for non-network block sources and whitelisted peers.
|
||||
* @param[out] dbp The already known disk position of pblock, or NULL if not yet stored.
|
||||
* @param[out] fNewBlock A boolean which is set to indicate if the block was first received via this call
|
||||
* @return True if state.IsValid()
|
||||
*/
|
||||
bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, const CDiskBlockPos* dbp, bool* fNewBlock);
|
||||
bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, bool* fNewBlock);
|
||||
|
||||
/**
|
||||
* Process incoming block headers.
|
||||
|
Loading…
Reference in New Issue
Block a user