@@ -2593,6 +2593,12 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
|||||||
|
|
||||||
// verify that the view's current state corresponds to the previous block
|
// verify that the view's current state corresponds to the previous block
|
||||||
uint256 hashPrevBlock = pindex->pprev == NULL ? uint256() : pindex->pprev->GetBlockHash();
|
uint256 hashPrevBlock = pindex->pprev == NULL ? uint256() : pindex->pprev->GetBlockHash();
|
||||||
|
if ( hashPrevBlock != view.GetBestBlock() )
|
||||||
|
{
|
||||||
|
fprintf(stderr,"ConnectBlock(): hashPrevBlock != view.GetBestBlock()\n");
|
||||||
|
return state.DoS(1, error("ConnectBlock(): hashPrevBlock != view.GetBestBlock()"),
|
||||||
|
REJECT_INVALID, "hashPrevBlock-not-bestblock");
|
||||||
|
}
|
||||||
assert(hashPrevBlock == view.GetBestBlock());
|
assert(hashPrevBlock == view.GetBestBlock());
|
||||||
|
|
||||||
// Special case for the genesis block, skipping connection of its transactions
|
// Special case for the genesis block, skipping connection of its transactions
|
||||||
|
|||||||
@@ -635,7 +635,7 @@ static bool ProcessBlockFound(CBlock* pblock)
|
|||||||
return error("KomodoMiner: ProcessNewBlock, block not accepted");
|
return error("KomodoMiner: ProcessNewBlock, block not accepted");
|
||||||
|
|
||||||
TrackMinedBlock(pblock->GetHash());
|
TrackMinedBlock(pblock->GetHash());
|
||||||
if ( vNodes.size() < KOMODO_LIMITED_NETWORKSIZE*2 )
|
//if ( vNodes.size() < KOMODO_LIMITED_NETWORKSIZE*2 )
|
||||||
{
|
{
|
||||||
int32_t n = 1;
|
int32_t n = 1;
|
||||||
//fprintf(stderr,"broadcast new block t.%u\n",(uint32_t)time(NULL));
|
//fprintf(stderr,"broadcast new block t.%u\n",(uint32_t)time(NULL));
|
||||||
@@ -648,7 +648,8 @@ static bool ProcessBlockFound(CBlock* pblock)
|
|||||||
if ( (rand() % n) == 0 )
|
if ( (rand() % n) == 0 )
|
||||||
{
|
{
|
||||||
pnode->PushMessage("block", *pblock);
|
pnode->PushMessage("block", *pblock);
|
||||||
n++;
|
if ( n++ > 8 )
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user