Merge pull request #1110 from blackjok3rtt/FSM

Fix sync issue banning peers.
This commit is contained in:
jl777
2018-12-17 22:56:44 -11:00
committed by GitHub
2 changed files with 12 additions and 8 deletions

View File

@@ -740,6 +740,11 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block,uint32_t prevtim
else if ( height > 814000 ) else if ( height > 814000 )
{ {
script = (uint8_t *)&block.vtx[0].vout[0].scriptPubKey[0]; script = (uint8_t *)&block.vtx[0].vout[0].scriptPubKey[0];
//int32_t notary = komodo_electednotary(&num,script+1,height,0);
//if ( (-1 * (komodo_electednotary(&num,script+1,height,0) >= 0) * (height > 1000000)) < 0 )
// fprintf(stderr, ">>>>>>> FAILED BLOCK.%d notary.%d insync.%d\n",height,notary,KOMODO_INSYNC);
//else
// fprintf(stderr, "<<<<<<< VALID BLOCK.%d notary.%d insync.%d\n",height,notary,KOMODO_INSYNC);
return(-1 * (komodo_electednotary(&num,script+1,height,0) >= 0) * (height > 1000000)); return(-1 * (komodo_electednotary(&num,script+1,height,0) >= 0) * (height > 1000000));
} }
} }
@@ -1521,4 +1526,3 @@ void komodo_passport_iteration()
printf("READY for %s RPC calls at %u! done PASSPORT %s refid.%d\n",ASSETCHAINS_SYMBOL,(uint32_t)time(NULL),ASSETCHAINS_SYMBOL,refid); printf("READY for %s RPC calls at %u! done PASSPORT %s refid.%d\n",ASSETCHAINS_SYMBOL,(uint32_t)time(NULL),ASSETCHAINS_SYMBOL,refid);
} }
} }

View File

@@ -4757,7 +4757,7 @@ bool CheckBlock(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,const C
if (nSigOps > MAX_BLOCK_SIGOPS) if (nSigOps > MAX_BLOCK_SIGOPS)
return state.DoS(100, error("CheckBlock: out-of-bounds SigOpCount"), return state.DoS(100, error("CheckBlock: out-of-bounds SigOpCount"),
REJECT_INVALID, "bad-blk-sigops", true); REJECT_INVALID, "bad-blk-sigops", true);
if ( komodo_check_deposit(height,block,(pindex==0||pindex->pprev==0)?0:pindex->pprev->nTime) < 0 ) if ( fCheckPOW && komodo_check_deposit(height,block,(pindex==0||pindex->pprev==0)?0:pindex->pprev->nTime) < 0 )
{ {
//static uint32_t counter; //static uint32_t counter;
//if ( counter++ < 100 && ASSETCHAINS_STAKED == 0 ) //if ( counter++ < 100 && ASSETCHAINS_STAKED == 0 )