Skip to content

Commit a13fa4c

Browse files
committed
Remove unused CDiskBlockPos* argument from ProcessNewBlock
1 parent dd0df81 commit a13fa4c

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
@@ -1951,7 +1951,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
19511951
bool fNewBlock = false;
19521952
// Since we requested this block (it was in mapBlocksInFlight), force it to be processed,
19531953
// even if it would not be a candidate for new tip (missing previous block, chain not long enough, etc)
1954-
ProcessNewBlock(chainparams, pblock, true, NULL, &fNewBlock);
1954+
ProcessNewBlock(chainparams, pblock, true, &fNewBlock);
19551955
if (fNewBlock)
19561956
pfrom->nLastBlockTime = GetTime();
19571957
}
@@ -2133,7 +2133,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
21332133
mapBlockSource.emplace(hash, std::make_pair(pfrom->GetId(), true));
21342134
}
21352135
bool fNewBlock = false;
2136-
ProcessNewBlock(chainparams, pblock, forceProcessing, NULL, &fNewBlock);
2136+
ProcessNewBlock(chainparams, pblock, forceProcessing, &fNewBlock);
21372137
if (fNewBlock)
21382138
pfrom->nLastBlockTime = GetTime();
21392139
}

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
@@ -3127,7 +3127,7 @@ static bool AcceptBlock(const CBlock& block, CValidationState& state, const CCha
31273127
return true;
31283128
}
31293129

3130-
bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, const CDiskBlockPos* dbp, bool *fNewBlock)
3130+
bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, bool *fNewBlock)
31313131
{
31323132
{
31333133
LOCK(cs_main);
@@ -3136,7 +3136,7 @@ bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<cons
31363136
CBlockIndex *pindex = NULL;
31373137
if (fNewBlock) *fNewBlock = false;
31383138
CValidationState state;
3139-
bool ret = AcceptBlock(*pblock, state, chainparams, &pindex, fForceProcessing, dbp, fNewBlock);
3139+
bool ret = AcceptBlock(*pblock, state, chainparams, &pindex, fForceProcessing, NULL, fNewBlock);
31403140
CheckBlockIndex(chainparams.GetConsensus());
31413141
if (!ret) {
31423142
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)