test
This commit is contained in:
@@ -151,7 +151,7 @@ int32_t komodo_gateway_depositremove(uint256 txid,uint16_t vout) // assetchain c
|
|||||||
|
|
||||||
int32_t komodo_check_deposit(const CBlock& block) // verify above block is valid pax pricing
|
int32_t komodo_check_deposit(const CBlock& block) // verify above block is valid pax pricing
|
||||||
{
|
{
|
||||||
int32_t i,j,n,opretlen,num,iter,matchflag,offset=1; uint256 hash,txids[64]; uint8_t shortflag; char base[16]; uint16_t vouts[64]; uint8_t *script; queue_t *Q; struct pax_transaction *ptr; struct queueitem *item;
|
int32_t i,j,n,opretlen,num,iter,matchflag,offset=1; uint256 txids[64]; uint8_t shortflag; char base[16]; uint16_t vouts[64]; uint8_t *script; queue_t *Q; struct pax_transaction *ptr; struct queueitem *item;
|
||||||
n = block.vtx[0].vout.size();
|
n = block.vtx[0].vout.size();
|
||||||
script = (uint8_t *)block.vtx[0].vout[n-1].scriptPubKey.data();
|
script = (uint8_t *)block.vtx[0].vout[n-1].scriptPubKey.data();
|
||||||
if ( n <= 2 || script[0] != 0x6a )
|
if ( n <= 2 || script[0] != 0x6a )
|
||||||
@@ -180,13 +180,13 @@ int32_t komodo_check_deposit(const CBlock& block) // verify above block is valid
|
|||||||
{
|
{
|
||||||
if ( ptr->fiatoshis == block.vtx[0].vout[i].nValue )
|
if ( ptr->fiatoshis == block.vtx[0].vout[i].nValue )
|
||||||
{
|
{
|
||||||
for (j=0; j<32; j++)
|
/*for (j=0; j<32; j++)
|
||||||
printf("%02x",((uint8_t *)&ptr->txid)[j]);
|
printf("%02x",((uint8_t *)&ptr->txid)[j]);
|
||||||
printf(" v%d matched %.8f vout.%d ",ptr->vout,dstr(ptr->fiatoshis),i);
|
printf(" v%d matched %.8f vout.%d ",ptr->vout,dstr(ptr->fiatoshis),i);
|
||||||
hash = block.GetHash();
|
hash = block.GetHash();
|
||||||
for (j=0; j<32; j++)
|
for (j=0; j<32; j++)
|
||||||
printf("%02x",((uint8_t *)&hash)[j]);
|
printf("%02x",((uint8_t *)&hash)[j]);
|
||||||
printf(".blockhash\n");
|
printf(".blockhash\n");*/
|
||||||
matchflag = 1;
|
matchflag = 1;
|
||||||
} else printf("error finding %.8f vout.%d\n",dstr(ptr->fiatoshis),i);
|
} else printf("error finding %.8f vout.%d\n",dstr(ptr->fiatoshis),i);
|
||||||
break;
|
break;
|
||||||
@@ -259,7 +259,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
|
|||||||
printf("%02x",((uint8_t *)&txids[i])[j]);
|
printf("%02x",((uint8_t *)&txids[i])[j]);
|
||||||
printf(" issuedtxid v%d i.%d of n.%d opretlen.%d\n",vouts[i],i,n,opretlen);
|
printf(" issuedtxid v%d i.%d of n.%d opretlen.%d\n",vouts[i],i,n,opretlen);
|
||||||
if ( komodo_gateway_depositremove(txids[i],vouts[i]) == 0 )
|
if ( komodo_gateway_depositremove(txids[i],vouts[i]) == 0 )
|
||||||
printf("error removing deposit\n");
|
printf("%s error removing deposit\n",ASSETCHAINS_SYMBOL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ int32_t komodo_nutxofind(int32_t height,uint256 txhash,int32_t vout)
|
|||||||
int32_t komodo_ratify_threshold(int32_t height,uint64_t signedmask)
|
int32_t komodo_ratify_threshold(int32_t height,uint64_t signedmask)
|
||||||
{
|
{
|
||||||
int32_t htind,numnotaries,i,wt = 0;
|
int32_t htind,numnotaries,i,wt = 0;
|
||||||
|
if ( ASSETCHAINS_SYMBOL[0] != 0 )
|
||||||
|
return(2);
|
||||||
if ( (htind= KOMODO_PUBKEYS_HEIGHT(height) / KOMODO_ELECTION_GAP) == 1 )
|
if ( (htind= KOMODO_PUBKEYS_HEIGHT(height) / KOMODO_ELECTION_GAP) == 1 )
|
||||||
htind = 0;
|
htind = 0;
|
||||||
numnotaries = Pubkeys[htind].numnotaries;
|
numnotaries = Pubkeys[htind].numnotaries;
|
||||||
|
|||||||
Reference in New Issue
Block a user