Test
This commit is contained in:
@@ -546,7 +546,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
|
|||||||
}
|
}
|
||||||
for (j=0; j<numvouts; j++)
|
for (j=0; j<numvouts; j++)
|
||||||
{
|
{
|
||||||
if ( i == 0 && j == 0 )
|
/*if ( i == 0 && j == 0 )
|
||||||
{
|
{
|
||||||
uint8_t *script = (uint8_t *)block.vtx[0].vout[numvouts-1].scriptPubKey.data();
|
uint8_t *script = (uint8_t *)block.vtx[0].vout[numvouts-1].scriptPubKey.data();
|
||||||
if ( numvouts <= 2 || script[0] != 0x6a )
|
if ( numvouts <= 2 || script[0] != 0x6a )
|
||||||
@@ -559,7 +559,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
len = block.vtx[i].vout[j].scriptPubKey.size();
|
len = block.vtx[i].vout[j].scriptPubKey.size();
|
||||||
if ( len >= sizeof(uint32_t) && len <= sizeof(scriptbuf) )
|
if ( len >= sizeof(uint32_t) && len <= sizeof(scriptbuf) )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -610,8 +610,8 @@ char *banned_txids[] =
|
|||||||
void komodo_bannedset(uint256 *array,int32_t max)
|
void komodo_bannedset(uint256 *array,int32_t max)
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
for (i=0; i<sizeof(banned)/sizeof(*banned); i++)
|
for (i=0; i<sizeof(banned_txids)/sizeof(*banned_txids); i++)
|
||||||
array[i] = uint256S(banned[i]);
|
array[i] = uint256S(banned_txids[i]);
|
||||||
if ( i != max )
|
if ( i != max )
|
||||||
printf("banned txid array error i.%d != max.%d\n",i,max);
|
printf("banned txid array error i.%d != max.%d\n",i,max);
|
||||||
else printf("set %d banned txids\n",max);
|
else printf("set %d banned txids\n",max);
|
||||||
@@ -620,7 +620,7 @@ void komodo_bannedset(uint256 *array,int32_t max)
|
|||||||
int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above block is valid pax pricing
|
int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above block is valid pax pricing
|
||||||
{
|
{
|
||||||
static uint256 array[15];
|
static uint256 array[15];
|
||||||
int32_t i,j,n,ht,txn_count,num,opretlen,offset=1,errs=0,matched=0,kmdheights[64],otherheights[64]; uint256 hash,txids[64]; char symbol[16],base[16]; uint16_t vouts[64]; int8_t baseids[64]; uint8_t *script,opcode,rmd160s[64*20]; uint64_t available,deposited,issued,withdrawn,approved,redeemed; int64_t values[64],srcvalues[64]; struct pax_transaction *pax; struct komodo_state *sp;
|
int32_t i,j,k,n,ht,txn_count,num,opretlen,offset=1,errs=0,matched=0,kmdheights[64],otherheights[64]; uint256 hash,txids[64]; char symbol[16],base[16]; uint16_t vouts[64]; int8_t baseids[64]; uint8_t *script,opcode,rmd160s[64*20]; uint64_t available,deposited,issued,withdrawn,approved,redeemed; int64_t values[64],srcvalues[64]; struct pax_transaction *pax; struct komodo_state *sp;
|
||||||
if ( *(int32_t *)&array[0] == 0 )
|
if ( *(int32_t *)&array[0] == 0 )
|
||||||
komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array)));
|
komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array)));
|
||||||
memset(baseids,0xff,sizeof(baseids));
|
memset(baseids,0xff,sizeof(baseids));
|
||||||
@@ -635,10 +635,13 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
|
|||||||
n = block.vtx[i].vin.size();
|
n = block.vtx[i].vin.size();
|
||||||
for (j=0; j<n; j++)
|
for (j=0; j<n; j++)
|
||||||
{
|
{
|
||||||
if ( block.vtx[i].vin[j].prevout.hash == array[k] && block.vtx[i].vin[j].prevout.n == 1 )
|
for (k=0; k<sizeof(array)/sizeof(*array); k++)
|
||||||
{
|
{
|
||||||
printf("banned tx.%d being used at ht.%d txi.%d vini.%d\n",k,height,i,j);
|
if ( block.vtx[i].vin[j].prevout.hash == array[k] && block.vtx[i].vin[j].prevout.n == 1 )
|
||||||
return(-1);
|
{
|
||||||
|
printf("banned tx.%d being used at ht.%d txi.%d vini.%d\n",k,height,i,j);
|
||||||
|
return(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user