test
This commit is contained in:
@@ -58,7 +58,7 @@ void komodo_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotar
|
||||
{
|
||||
if ( fread(&ht,1,sizeof(ht),fp) != sizeof(ht) )
|
||||
errs++;
|
||||
printf("fpos.%ld func.(%d %c) ht.%d\n",ftell(fp),func,func,ht);
|
||||
printf("fpos.%ld func.(%d %c) ht.%d ",ftell(fp),func,func,ht);
|
||||
if ( func == 'P' )
|
||||
{
|
||||
if ( (num= fgetc(fp)) < 64 )
|
||||
@@ -71,7 +71,7 @@ void komodo_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotar
|
||||
komodo_notarysinit(ht,pubkeys,num);
|
||||
}
|
||||
} else printf("illegal num.%d\n",num);
|
||||
//printf("P[%d]\n",num);
|
||||
printf("P[%d]\n",num);
|
||||
}
|
||||
else if ( func == 'N' )
|
||||
{
|
||||
@@ -89,7 +89,7 @@ void komodo_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotar
|
||||
uint8_t n,nid; uint256 hash; uint64_t mask;
|
||||
n = fgetc(fp);
|
||||
nid = fgetc(fp);
|
||||
//printf("U %d %d\n",n,nid);
|
||||
printf("U %d %d\n",n,nid);
|
||||
if ( fread(&mask,1,sizeof(mask),fp) != sizeof(mask) )
|
||||
errs++;
|
||||
if ( fread(&hash,1,sizeof(hash),fp) != sizeof(hash) )
|
||||
@@ -104,8 +104,8 @@ void komodo_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotar
|
||||
if ( kheight > KMDHEIGHT )
|
||||
{
|
||||
KMDHEIGHT = kheight;
|
||||
printf("KMDHEIGHT <- %d\n",kheight);
|
||||
}
|
||||
printf("ht.%d KMDHEIGHT <- %d\n",ht,kheight);
|
||||
}
|
||||
else if ( func == 'R' )
|
||||
{
|
||||
|
||||
@@ -327,8 +327,8 @@ void komodo_paxpricefeed(int32_t height,uint8_t *pricefeed,int32_t opretlen)
|
||||
|
||||
uint64_t PAX_fiatdest(int32_t tokomodo,char *destaddr,uint8_t pubkey33[33],char *coinaddr,int32_t height,char *origbase,int64_t fiatoshis)
|
||||
{
|
||||
uint8_t shortflag = 0; char base[4]; int32_t i; uint8_t addrtype,rmd160[20]; uint64_t komodoshis = 0;
|
||||
if ( strcmp(base,(char *)"KMD") == 0 || strcmp(base,(char *)"kmd") == 0 )
|
||||
uint8_t shortflag = 0; char base[4]; int32_t i,baseid; uint8_t addrtype,rmd160[20]; uint64_t komodoshis = 0;
|
||||
if ( (baseid= komodo_baseid(origbase)) < 0 || baseid == MAX_CURRENCIES )
|
||||
return(0);
|
||||
for (i=0; i<3; i++)
|
||||
base[i] = toupper(origbase[i]);
|
||||
@@ -338,7 +338,7 @@ uint64_t PAX_fiatdest(int32_t tokomodo,char *destaddr,uint8_t pubkey33[33],char
|
||||
komodoshis = komodo_paxprice(height,base,(char *)"KMD",(uint64_t)fiatoshis);
|
||||
if ( bitcoin_addr2rmd160(&addrtype,rmd160,coinaddr) == 20 )
|
||||
{
|
||||
PAX_pubkey(1,pubkey33,&addrtype,rmd160,base,&shortflag,&fiatoshis);
|
||||
PAX_pubkey(1,pubkey33,&addrtype,rmd160,base,&shortflag,tokomodo != 0 ? &komodoshis : &fiatoshis);
|
||||
bitcoin_address(destaddr,KOMODO_PUBTYPE,pubkey33,33);
|
||||
}
|
||||
return(komodoshis);
|
||||
|
||||
Reference in New Issue
Block a user