test
This commit is contained in:
40
src/komodo.h
40
src/komodo.h
@@ -90,30 +90,38 @@ 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,height,txn_count,len;
|
char *scriptstr; int32_t i,j,height,txn_count,len,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;
|
||||||
txn_count = block.vtx.size();
|
txn_count = block.vtx.size();
|
||||||
if ( txn_count == 0 )
|
for (j=0; j<3; j++)
|
||||||
{
|
{
|
||||||
printf("no transactions for ht.%d\n",height);
|
if ( txn_count == 0 )
|
||||||
if ( ReadBlockFromDisk(block,pindex,1) == 0 )
|
|
||||||
{
|
{
|
||||||
printf("komodo_connectblock: ht.%d error reading block\n",height);
|
printf("no transactions for ht.%d\n",height);
|
||||||
return;
|
if ( ReadBlockFromDisk(block,pindex,1) == 0 )
|
||||||
|
{
|
||||||
|
printf("komodo_connectblock: ht.%d error reading block\n",height);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
txn_count = block.vtx.size();
|
||||||
|
printf("new txn_count.%d\n",txn_count);
|
||||||
}
|
}
|
||||||
txn_count = block.vtx.size();
|
for (i=0; i<txn_count; i++)
|
||||||
printf("new txn_count.%d\n",txn_count);
|
{
|
||||||
}
|
scriptstr = (char *)block.vtx[i].vout[0].scriptPubKey.ToString().c_str();
|
||||||
for (i=0; i<txn_count; i++)
|
len = strlen(scriptstr);
|
||||||
{
|
if ( len > 0 )
|
||||||
scriptstr = (char *)block.vtx[i].vout[0].scriptPubKey.ToString().c_str();
|
flag++;
|
||||||
len = strlen(scriptstr);
|
if ( strncmp(scriptstr,CRYPTO777_PUBSECPSTR,66) == 0 )
|
||||||
if ( strncmp(scriptstr,CRYPTO777_PUBSECPSTR,66) == 0 )
|
printf(">>>>>>>> ");
|
||||||
printf(">>>>>>>> ");
|
printf("ht.%d txi.%d (%s)\n",height,i,scriptstr);
|
||||||
printf("ht.%d txi.%d (%s)\n",height,i,scriptstr);
|
}
|
||||||
|
if ( flag != 0 )
|
||||||
|
break;
|
||||||
|
sleep(1);
|
||||||
}
|
}
|
||||||
} else printf("komodo_connectblock: unexpected null pindex\n");
|
} else printf("komodo_connectblock: unexpected null pindex\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user