This commit is contained in:
jl777
2018-04-20 11:29:12 +03:00
parent 592f6fa210
commit fd835d9406

View File

@@ -3542,8 +3542,10 @@ CBlockIndex* AddToBlockIndex(const CBlockHeader& block)
uint256 hash = block.GetHash(); uint256 hash = block.GetHash();
BlockMap::iterator it = mapBlockIndex.find(hash); BlockMap::iterator it = mapBlockIndex.find(hash);
if (it != mapBlockIndex.end()) if (it != mapBlockIndex.end())
{
fprintf(stderr,"addtoblockindex already there %p vs end.%p\n",it->second,mapBlockIndex.end());
return it->second; return it->second;
}
// Construct new block index object // Construct new block index object
CBlockIndex* pindexNew = new CBlockIndex(block); CBlockIndex* pindexNew = new CBlockIndex(block);
assert(pindexNew); assert(pindexNew);
@@ -4136,8 +4138,8 @@ bool ProcessNewBlock(bool from_miner,int32_t height,CValidationState &state, CNo
{ {
if ( (pindex= miSelf->second) == 0 ) // create pindex so first Accept block doesnt fail if ( (pindex= miSelf->second) == 0 ) // create pindex so first Accept block doesnt fail
{ {
fprintf(stderr,"Block header %s is already known, but without pindex\n",hash.ToString().c_str()); pindex = AddToBlockIndex(*pblock);
AddToBlockIndex(*pblock); fprintf(stderr,"Block header %s is already known, but without pindex -> %p\n",hash.ToString().c_str(),pindex);
} }
} }
} }