Skip to content

Commit b68685a

Browse files
committed
Merge #9273: Remove unused CDiskBlockPos* argument from ProcessNewBlock
a13fa4c Remove unused CDiskBlockPos* argument from ProcessNewBlock (Matt Corallo)
2 parents 57e337d + a13fa4c commit b68685a

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

src/net_processing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,7 +1952,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
19521952
bool fNewBlock = false;
19531953
// Since we requested this block (it was in mapBlocksInFlight), force it to be processed,
19541954
// even if it would not be a candidate for new tip (missing previous block, chain not long enough, etc)
1955-
ProcessNewBlock(chainparams, pblock, true, NULL, &fNewBlock);
1955+
ProcessNewBlock(chainparams, pblock, true, &fNewBlock);
19561956
if (fNewBlock)
19571957
pfrom->nLastBlockTime = GetTime();
19581958
}
@@ -2134,7 +2134,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
21342134
mapBlockSource.emplace(hash, std::make_pair(pfrom->GetId(), true));
21352135
}
21362136
bool fNewBlock = false;
2137-
ProcessNewBlock(chainparams, pblock, forceProcessing, NULL, &fNewBlock);
2137+
ProcessNewBlock(chainparams, pblock, forceProcessing, &fNewBlock);
21382138
if (fNewBlock)
21392139
pfrom->nLastBlockTime = GetTime();
21402140
}

src/rpc/mining.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ UniValue generateBlocks(boost::shared_ptr<CReserveScript> coinbaseScript, int nG
132132
continue;
133133
}
134134
std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(*pblock);
135-
if (!ProcessNewBlock(Params(), shared_pblock, true, NULL, NULL))
135+
if (!ProcessNewBlock(Params(), shared_pblock, true, NULL))
136136
throw JSONRPCError(RPC_INTERNAL_ERROR, "ProcessNewBlock, block not accepted");
137137
++nHeight;
138138
blockHashes.push_back(pblock->GetHash().GetHex());
@@ -760,7 +760,7 @@ UniValue submitblock(const JSONRPCRequest& request)
760760

761761
submitblock_StateCatcher sc(block.GetHash());
762762
RegisterValidationInterface(&sc);
763-
bool fAccepted = ProcessNewBlock(Params(), blockptr, true, NULL, NULL);
763+
bool fAccepted = ProcessNewBlock(Params(), blockptr, true, NULL);
764764
UnregisterValidationInterface(&sc);
765765
if (fBlockPresent)
766766
{

src/test/miner_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
224224
pblock->hashMerkleRoot = BlockMerkleRoot(*pblock);
225225
pblock->nNonce = blockinfo[i].nonce;
226226
std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(*pblock);
227-
BOOST_CHECK(ProcessNewBlock(chainparams, shared_pblock, true, NULL, NULL));
227+
BOOST_CHECK(ProcessNewBlock(chainparams, shared_pblock, true, NULL));
228228
pblock->hashPrevBlock = pblock->GetHash();
229229
}
230230

src/test/test_bitcoin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>&
128128
while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce;
129129

130130
std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(block);
131-
ProcessNewBlock(chainparams, shared_pblock, true, NULL, NULL);
131+
ProcessNewBlock(chainparams, shared_pblock, true, NULL);
132132

133133
CBlock result = block;
134134
return result;

src/validation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3116,7 +3116,7 @@ static bool AcceptBlock(const CBlock& block, CValidationState& state, const CCha
31163116
return true;
31173117
}
31183118

3119-
bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, const CDiskBlockPos* dbp, bool *fNewBlock)
3119+
bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, bool *fNewBlock)
31203120
{
31213121
{
31223122
LOCK(cs_main);
@@ -3125,7 +3125,7 @@ bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<cons
31253125
CBlockIndex *pindex = NULL;
31263126
if (fNewBlock) *fNewBlock = false;
31273127
CValidationState state;
3128-
bool ret = AcceptBlock(*pblock, state, chainparams, &pindex, fForceProcessing, dbp, fNewBlock);
3128+
bool ret = AcceptBlock(*pblock, state, chainparams, &pindex, fForceProcessing, NULL, fNewBlock);
31293129
CheckBlockIndex(chainparams.GetConsensus());
31303130
if (!ret) {
31313131
GetMainSignals().BlockChecked(*pblock, state);

src/validation.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,10 @@ static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 550 * 1024 * 1024;
229229
*
230230
* @param[in] pblock The block we want to process.
231231
* @param[in] fForceProcessing Process this block even if unrequested; used for non-network block sources and whitelisted peers.
232-
* @param[out] dbp The already known disk position of pblock, or NULL if not yet stored.
233232
* @param[out] fNewBlock A boolean which is set to indicate if the block was first received via this call
234233
* @return True if state.IsValid()
235234
*/
236-
bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, const CDiskBlockPos* dbp, bool* fNewBlock);
235+
bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, bool* fNewBlock);
237236

238237
/**
239238
* Process incoming block headers.

0 commit comments

Comments
 (0)