Merge pull request #601 from jl777/jl777

Jl777
This commit is contained in:
jl777
2018-04-20 22:01:57 +03:00
committed by GitHub
2 changed files with 5 additions and 2 deletions

View File

@@ -1170,6 +1170,8 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he
percPoS++;
fprintf(stderr,"0");
}
if ( (i % 10) == 9 )
fprintf(stderr," %d, ",percPoS);
}
}
fprintf(stderr," -> %d%% percPoS ht.%d\n",percPoS,height);

View File

@@ -3544,7 +3544,8 @@ CBlockIndex* AddToBlockIndex(const CBlockHeader& block)
BlockMap::iterator miPrev = mapBlockIndex.find(block.hashPrevBlock);
if (it != mapBlockIndex.end())
{
if ( vNodes.size() >= KOMODO_LIMITED_NETWORKSIZE || it->second != 0 ) // change behavior to allow komodo_ensure to work
if ( ASSETCHAINS_STAKED == 0 || it->second != 0 ) // change behavior to allow komodo_ensure to work
//if ( vNodes.size() >= KOMODO_LIMITED_NETWORKSIZE || it->second != 0 ) // change behavior to allow komodo_ensure to work
{
// this is the strange case where somehow the hash is in the mapBlockIndex via as yet undetermined process, but the pindex for the hash is not there. Theoretically it is due to processing the block headers, but I have seen it get this case without having received it from the block headers or anywhere else... jl777
//fprintf(stderr,"addtoblockindex already there %p\n",it->second);
@@ -4155,7 +4156,7 @@ bool ProcessNewBlock(bool from_miner,int32_t height,CValidationState &state, CNo
}
// Store to disk
CBlockIndex *pindex = NULL;
if ( vNodes.size() < KOMODO_LIMITED_NETWORKSIZE )
if ( ASSETCHAINS_STAKED != 0 )//vNodes.size() < KOMODO_LIMITED_NETWORKSIZE )
{
// without the komodo_ensure call, it is quite possible to get a non-error but null pindex returned from AcceptBlockHeader. In a 2 node network, it will be a long time before that block is reprocessed. Even though restarting makes it rescan, it seems much better to keep the nodes in sync
komodo_ensure(pblock,hash);