test
This commit is contained in:
@@ -27,7 +27,7 @@ int32_t pax_fiatstatus(uint64_t *deposited,uint64_t *issued,uint64_t *withdrawn,
|
||||
*withdrawn = sp->withdrawn;
|
||||
*approved = sp->approved;
|
||||
*redeemed = sp->redeemed;
|
||||
printf("%p %s %.8f %.8f %.8f %.8f %.8f\n",sp,base,dstr(*deposited),dstr(*issued),dstr(*withdrawn),dstr(*approved),dstr(*redeemed));
|
||||
//printf("%p %s %.8f %.8f %.8f %.8f %.8f\n",sp,base,dstr(*deposited),dstr(*issued),dstr(*withdrawn),dstr(*approved),dstr(*redeemed));
|
||||
return(0);
|
||||
} else printf("pax_fiatstatus cant get basesp.%s\n",base);
|
||||
} else printf("pax_fiatstatus illegal base.%s\n",base);
|
||||
@@ -105,39 +105,44 @@ void komodo_gateway_deposit(char *coinaddr,uint64_t value,char *symbol,uint64_t
|
||||
pax->height = height;
|
||||
if ( otherheight != 0 )
|
||||
pax->otherheight = otherheight;
|
||||
if ( pax->didstats == 0 && fiatoshis == 0 )
|
||||
{
|
||||
if ( (pax->approved= approved) != 0 )
|
||||
{
|
||||
if ( (basesp= komodo_stateptrget(symbol)) != 0 )
|
||||
{
|
||||
basesp->approved += fiatoshis;
|
||||
printf("########### %p approved %s += %.8f\n",basesp,symbol,dstr(fiatoshis));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ASSETCHAINS_SYMBOL[0] == 0 )
|
||||
{
|
||||
if ( (basesp= komodo_stateptrget(source)) != 0 )
|
||||
{
|
||||
basesp->withdrawn += fiatoshis;
|
||||
printf("########### %p withdrawn %s += %.8f\n",basesp,source,dstr(fiatoshis));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (basesp= komodo_stateptrget(symbol)) != 0 )
|
||||
{
|
||||
basesp->deposited += fiatoshis;
|
||||
printf("########### %p deposited %s += %.8f\n",basesp,symbol,dstr(fiatoshis));
|
||||
}
|
||||
}
|
||||
}
|
||||
pax->didstats = 1;
|
||||
}
|
||||
if ( pax->marked == 0 )
|
||||
{
|
||||
if ( addflag != 0 )
|
||||
{
|
||||
if ( (pax->approved= approved) != 0 )
|
||||
{
|
||||
s = (char *)"APPROVED";
|
||||
if ( (basesp= komodo_stateptrget(symbol)) != 0 )
|
||||
{
|
||||
basesp->approved += fiatoshis;
|
||||
printf("########### %p approved %s += %.8f\n",basesp,symbol,dstr(fiatoshis));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
s = (char *)((ASSETCHAINS_SYMBOL[0] == 0) ? "WITHDRAW" : "DEPOSIT");
|
||||
if ( ASSETCHAINS_SYMBOL[0] == 0 )
|
||||
{
|
||||
if ( (basesp= komodo_stateptrget(source)) != 0 )
|
||||
{
|
||||
basesp->withdrawn += fiatoshis;
|
||||
printf("########### %p withdrawn %s += %.8f\n",basesp,source,dstr(fiatoshis));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (basesp= komodo_stateptrget(symbol)) != 0 )
|
||||
{
|
||||
basesp->deposited += fiatoshis;
|
||||
printf("########### %p deposited %s += %.8f\n",basesp,symbol,dstr(fiatoshis));
|
||||
}
|
||||
}
|
||||
}
|
||||
else s = (char *)((ASSETCHAINS_SYMBOL[0] == 0) ? "WITHDRAW" : "DEPOSIT");
|
||||
printf("[%s] addflag.%d ADD %s/%s %s %.8f -> %s TO PAX ht.%d otherht.%d total %.8f\n",ASSETCHAINS_SYMBOL,addflag,s,symbol,source,dstr(ASSETCHAINS_SYMBOL[0]==0?pax->komodoshis:pax->fiatoshis),pax->coinaddr,pax->height,pax->otherheight,dstr(komodo_paxtotal()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ struct pax_transaction
|
||||
UT_hash_handle hh;
|
||||
uint256 txid;
|
||||
uint64_t komodoshis,fiatoshis,validated;
|
||||
int32_t marked,height,otherheight,approved;
|
||||
int32_t marked,height,otherheight,approved,didstats;
|
||||
uint16_t vout;
|
||||
char symbol[16],source[16],coinaddr[64]; uint8_t rmd160[20],shortflag;
|
||||
};
|
||||
|
||||
@@ -500,11 +500,11 @@ Value paxpending(const Array& params, bool fHelp)
|
||||
{
|
||||
if ( deposited != 0 || issued != 0 || withdrawn != 0 || approved != 0 || redeemed != 0 )
|
||||
{
|
||||
item.push_back(Pair("deposited", deposited));
|
||||
item.push_back(Pair("issued", issued));
|
||||
item.push_back(Pair("withdrawn", withdrawn));
|
||||
item.push_back(Pair("approved", approved));
|
||||
item.push_back(Pair("redeemed", redeemed));
|
||||
item.push_back(Pair("deposited", ValueFromAmount(deposited)));
|
||||
item.push_back(Pair("issued", ValueFromAmount(issued)));
|
||||
item.push_back(Pair("withdrawn", ValueFromAmount(withdrawn)));
|
||||
item.push_back(Pair("approved", ValueFromAmount(approved)));
|
||||
item.push_back(Pair("redeemed", ValueFromAmount(redeemed)));
|
||||
obj.push_back(Pair(CURRENCIES[baseid],item));
|
||||
a.push_back(obj);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user