This commit is contained in:
jl777
2016-12-22 23:10:10 +02:00
parent 5cb9312f6c
commit 109afe6435

View File

@@ -215,7 +215,7 @@ int32_t komodo_issued_opreturn(char *base,uint256 *txids,uint16_t *vouts,int64_t
otherheights[n] = p.otherheight; otherheights[n] = p.otherheight;
memcpy(&rmd160s[n * 20],p.rmd160,20); memcpy(&rmd160s[n * 20],p.rmd160,20);
baseids[n] = komodo_baseid(p.source); baseids[n] = komodo_baseid(p.source);
if ( 1 ) if ( 0 )
{ {
char coinaddr[64]; char coinaddr[64];
bitcoin_address(coinaddr,60,&rmd160s[n * 20],20); bitcoin_address(coinaddr,60,&rmd160s[n * 20],20);
@@ -320,10 +320,10 @@ uint64_t komodo_paxtotal()
else if ( pax->validated == 0 ) else if ( pax->validated == 0 )
{ {
pax->validated = pax->komodoshis = checktoshis; pax->validated = pax->komodoshis = checktoshis;
int32_t j; for (j=0; j<32; j++) //int32_t j; for (j=0; j<32; j++)
printf("%02x",((uint8_t *)&pax->txid)[j]); // printf("%02x",((uint8_t *)&pax->txid)[j]);
//if ( strcmp(str,ASSETCHAINS_SYMBOL) == 0 ) //if ( strcmp(str,ASSETCHAINS_SYMBOL) == 0 )
printf(" v%d %p got WITHDRAW.%s kmd.%d ht.%d %.8f -> %.8f/%.8f\n",pax->vout,pax,pax->source,pax->height,pax->otherheight,dstr(pax->fiatoshis),dstr(pax->komodoshis),dstr(checktoshis)); // printf(" v%d %p got WITHDRAW.%s kmd.%d ht.%d %.8f -> %.8f/%.8f\n",pax->vout,pax,pax->source,pax->height,pax->otherheight,dstr(pax->fiatoshis),dstr(pax->komodoshis),dstr(checktoshis));
} }
} }
} }
@@ -361,7 +361,7 @@ uint64_t komodo_paxtotal()
{ {
seed = 0; seed = 0;
checktoshis = komodo_paxprice(&seed,pax->height,pax->source,(char *)"KMD",(uint64_t)pax->fiatoshis); checktoshis = komodo_paxprice(&seed,pax->height,pax->source,(char *)"KMD",(uint64_t)pax->fiatoshis);
printf("PAX_fiatdest ht.%d price %s %.8f -> KMD %.8f vs %.8f\n",pax->height,pax->symbol,(double)pax->fiatoshis/COIN,(double)pax->komodoshis/COIN,(double)checktoshis/COIN); //printf("PAX_fiatdest ht.%d price %s %.8f -> KMD %.8f vs %.8f\n",pax->height,pax->symbol,(double)pax->fiatoshis/COIN,(double)pax->komodoshis/COIN,(double)checktoshis/COIN);
//printf(" v%d %.8f k.%d ht.%d\n",pax->vout,dstr(pax->komodoshis),pax->height,pax->otherheight); //printf(" v%d %.8f k.%d ht.%d\n",pax->vout,dstr(pax->komodoshis),pax->height,pax->otherheight);
if ( seed != 0 && checktoshis != 0 ) if ( seed != 0 && checktoshis != 0 )
{ {
@@ -840,7 +840,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
else if ( tokomodo != 0 && opretbuf[0] == 'A' ) else if ( tokomodo != 0 && opretbuf[0] == 'A' )
{ {
tokomodo = 1; tokomodo = 1;
//if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 )
{ {
for (i=0; i<opretlen; i++) for (i=0; i<opretlen; i++)
printf("%02x",opretbuf[i]); printf("%02x",opretbuf[i]);
@@ -850,9 +850,9 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
{ {
for (i=0; i<n; i++) for (i=0; i<n; i++)
{ {
for (j=0; j<32; j++) //for (j=0; j<32; j++)
printf("%02x",((uint8_t *)&txids[i])[j]); // printf("%02x",((uint8_t *)&txids[i])[j]);
printf(" v%d %.8f k.%d ht.%d base.%d\n",vouts[i],dstr(values[i]),kmdheights[i],otherheights[i],baseids[i]); //printf(" v%d %.8f k.%d ht.%d base.%d\n",vouts[i],dstr(values[i]),kmdheights[i],otherheights[i],baseids[i]);
if ( baseids[i] < 0 ) if ( baseids[i] < 0 )
{ {
printf("baseids[%d] %d\n",i,baseids[i]); printf("baseids[%d] %d\n",i,baseids[i]);
@@ -861,7 +861,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
didstats = 0; didstats = 0;
seed = 0; seed = 0;
checktoshis = komodo_paxprice(&seed,kmdheights[i],CURRENCIES[baseids[i]],(char *)"KMD",(uint64_t)values[i]); checktoshis = komodo_paxprice(&seed,kmdheights[i],CURRENCIES[baseids[i]],(char *)"KMD",(uint64_t)values[i]);
printf("PAX_fiatdest ht.%d price %s %.8f -> KMD %.8f vs %.8f\n",kmdheights[i],CURRENCIES[baseids[i]],(double)values[i]/COIN,(double)srcvalues[i]/COIN,(double)checktoshis/COIN); //printf("PAX_fiatdest ht.%d price %s %.8f -> KMD %.8f vs %.8f\n",kmdheights[i],CURRENCIES[baseids[i]],(double)values[i]/COIN,(double)srcvalues[i]/COIN,(double)checktoshis/COIN);
if ( srcvalues[i] == checktoshis ) if ( srcvalues[i] == checktoshis )
{ {
if ( (pax= komodo_paxfind(txids[i],vouts[i],'A')) == 0 ) if ( (pax= komodo_paxfind(txids[i],vouts[i],'A')) == 0 )