Debugging
This commit is contained in:
22
src/main.cpp
22
src/main.cpp
@@ -4193,16 +4193,18 @@ CBlockIndex* AddToBlockIndex(const CBlockHeader& block)
|
|||||||
BlockMap::iterator miPrev = mapBlockIndex.find(block.hashPrevBlock);
|
BlockMap::iterator miPrev = mapBlockIndex.find(block.hashPrevBlock);
|
||||||
|
|
||||||
// the following block is for debugging, comment when not needed
|
// the following block is for debugging, comment when not needed
|
||||||
int countNull = 0;
|
/*
|
||||||
int totalIdx = 0;
|
std::vector<BlockMap::iterator> vrit;
|
||||||
for (auto bit : mapBlockIndex)
|
for (BlockMap::iterator bit = mapBlockIndex.begin(); bit != mapBlockIndex.end(); bit++)
|
||||||
{
|
{
|
||||||
totalIdx++;
|
if (bit->second == NULL)
|
||||||
if (bit.second == NULL)
|
vrit.push_back(bit);
|
||||||
countNull++;
|
|
||||||
}
|
}
|
||||||
if (countNull)
|
if (!vrit.empty())
|
||||||
printf("%d total, %d NULL\n", totalIdx, countNull);
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if (it != mapBlockIndex.end())
|
if (it != mapBlockIndex.end())
|
||||||
{
|
{
|
||||||
@@ -5878,7 +5880,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
|
|||||||
std::pair<std::multimap<uint256, CDiskBlockPos>::iterator, std::multimap<uint256, CDiskBlockPos>::iterator> range = mapBlocksUnknownParent.equal_range(head);
|
std::pair<std::multimap<uint256, CDiskBlockPos>::iterator, std::multimap<uint256, CDiskBlockPos>::iterator> range = mapBlocksUnknownParent.equal_range(head);
|
||||||
while (range.first != range.second) {
|
while (range.first != range.second) {
|
||||||
std::multimap<uint256, CDiskBlockPos>::iterator it = range.first;
|
std::multimap<uint256, CDiskBlockPos>::iterator it = range.first;
|
||||||
if (ReadBlockFromDisk(mapBlockIndex[hash]!=0?mapBlockIndex[hash]->GetHeight():0,block, it->second,1))
|
if (ReadBlockFromDisk(mapBlockIndex.count(hash)!=0?mapBlockIndex[hash]->GetHeight():0,block, it->second,1))
|
||||||
{
|
{
|
||||||
LogPrintf("%s: Processing out of order child %s of %s\n", __func__, block.GetHash().ToString(),
|
LogPrintf("%s: Processing out of order child %s of %s\n", __func__, block.GetHash().ToString(),
|
||||||
head.ToString());
|
head.ToString());
|
||||||
@@ -6348,7 +6350,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("netmsg: %s\n", strCommand.c_str());
|
//printf("netmsg: %s\n", strCommand.c_str());
|
||||||
|
|
||||||
if (strCommand == "version")
|
if (strCommand == "version")
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user