This commit is contained in:
jl777
2016-10-18 16:13:00 -03:00
parent 0f42af4c39
commit 33a5b0c802

View File

@@ -90,11 +90,13 @@ int32_t komodo_blockindexcheck(CBlockIndex *pindex,uint32_t *nBitsp)
void komodo_connectblock(CBlockIndex *pindex,CBlock& block) void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
{ {
char *scriptstr; int32_t i,j,k,numvins,numvouts,height,txn_count; char *scriptstr; int32_t iter,i,j,k,numvins,numvouts,height,txn_count,flag=0;
// update voting results and official (height, notaries[]) // update voting results and official (height, notaries[])
if ( pindex != 0 ) if ( pindex != 0 )
{ {
height = pindex->nHeight; height = pindex->nHeight;
for (iter=0; iter<13; iter++)
{
txn_count = block.vtx.size(); txn_count = block.vtx.size();
for (i=0; i<txn_count; i++) for (i=0; i<txn_count; i++)
{ {
@@ -103,6 +105,8 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
for (j=0; j<numvouts; j++) for (j=0; j<numvouts; j++)
{ {
scriptstr = (char *)block.vtx[i].vout[j].scriptPubKey.ToString().c_str(); scriptstr = (char *)block.vtx[i].vout[j].scriptPubKey.ToString().c_str();
if ( scriptstr[0] != 0 )
flag++;
if ( strncmp(scriptstr,CRYPTO777_PUBSECPSTR,66) == 0 ) if ( strncmp(scriptstr,CRYPTO777_PUBSECPSTR,66) == 0 )
printf(">>>>>>>> "); printf(">>>>>>>> ");
else if ( i == 0 && j == 0 ) else if ( i == 0 && j == 0 )
@@ -122,6 +126,15 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
printf("ht.%d txi.%d vout.%d (%s)\n",height,i,j,scriptstr); printf("ht.%d txi.%d vout.%d (%s)\n",height,i,j,scriptstr);
} }
} }
if ( flag != 0 )
break;
sleep(1);
if ( ReadBlockFromDisk(block,pindex,1) == 0 )
{
printf("error readblock.%d\n",height);
return(0);
}
}
} else printf("komodo_connectblock: unexpected null pindex\n"); } else printf("komodo_connectblock: unexpected null pindex\n");
} }