Browse Source

Merge pull request #324 from jl777/dev

Test
beta
jl777 8 years ago
committed by GitHub
parent
commit
1295c0931d
  1. 12
      basilisk/jumblr.c

12
basilisk/jumblr.c

@ -408,12 +408,12 @@ int64_t jumblr_DEXsplit(struct supernet_info *myinfo,struct iguana_info *coin,bi
outputs[numoutputs++] = value;
remaining -= value;
total += value;
printf("%.8f ",dstr(value));
//printf("%.8f ",dstr(value));
n++;
}
}
}
char str[65]; printf("numoutputs.%d total %.8f %s/v%d\n",numoutputs,dstr(total),bits256_str(str,txid),vout);
//char str[65]; printf("numoutputs.%d total %.8f %s/v%d\n",numoutputs,dstr(total),bits256_str(str,txid),vout);
if ( numoutputs > 0 )
{
if ( (retstr= _dex_gettxout(myinfo,coin->symbol,txid,vout)) != 0 )
@ -525,7 +525,7 @@ int32_t jumblr_DEXutxoupdate(struct supernet_info *myinfo,struct iguana_info *co
amount = dstr(value);
memset(splittxidp,0,sizeof(*splittxidp));
depositfactor = jumblr_DEXutxosize(&targetvolB,&targetvolM,&targetvolS,isbob,kmdprice);
printf("depositfactor %.8f targetvols %.8f %.8f %.8f\n",depositfactor,targetvolB,targetvolM,targetvolS);
//printf("depositfactor %.8f targetvols %.8f %.8f %.8f\n",depositfactor,targetvolB,targetvolM,targetvolS);
fees[0] = estfee + (margin * targetvolB) / dexfeeratio;
fees[1] = estfee + (margin * targetvolM) / dexfeeratio;
fees[2] = estfee + (margin * targetvolS) / dexfeeratio;
@ -594,7 +594,7 @@ void jumblr_utxoupdate(struct supernet_info *myinfo,struct iguana_info *coin,dou
char *retstr; cJSON *array,*item; int32_t i,n,vout,ind; bits256 txid,splittxid; uint64_t value;
if ( (retstr= jumblr_listunspent(myinfo,coin,coinaddr)) != 0 )
{
printf("%s.(%s)\n",coin->symbol,retstr);
//printf("%s.(%s)\n",coin->symbol,retstr);
if ( (array= cJSON_Parse(retstr)) != 0 )
{
if ( (n= cJSON_GetArraySize(array)) > 0 )
@ -605,7 +605,7 @@ void jumblr_utxoupdate(struct supernet_info *myinfo,struct iguana_info *coin,dou
txid = jbits256(item,"txid");
vout = jint(item,"vout");
value = SATOSHIDEN * jdouble(item,"amount");
printf("price %.8f %llx/v%d %.8f %d of %d\n",price,(long long)txid.txid,vout,dstr(value),i,n);
//printf("price %.8f %llx/v%d %.8f %d of %d\n",price,(long long)txid.txid,vout,dstr(value),i,n);
if ( jumblr_utxotxidpending(myinfo,&splittxid,&ind,coin,txid,vout) < 0 )
{
ind = jumblr_DEXutxoupdate(myinfo,coin,&splittxid,coinaddr,privkey,txid,vout,value,myinfo->IAMLP,price,estfee);
@ -648,7 +648,7 @@ void jumblr_DEXupdate(struct supernet_info *myinfo,struct iguana_info *coin,char
}
ptr->avail = dstr(jumblr_balance(myinfo,ptr->coin,ptr->depositaddr));
ptr->btcprice = get_theoretical(&avebid,&aveask,&highbid,&lowask,&CMC_average,changes,CMCname,symbol,"BTC",&ptr->USD_average);
printf("%s avail %.8f btcprice %.8f deposit.(%s %s) -> jumblr.(%s %s)\n",symbol,ptr->avail,ptr->btcprice,ptr->depositaddr,ptr->KMDdepositaddr,ptr->jumblraddr,ptr->KMDjumblraddr);
//printf("%s avail %.8f btcprice %.8f deposit.(%s %s) -> jumblr.(%s %s)\n",symbol,ptr->avail,ptr->btcprice,ptr->depositaddr,ptr->KMDdepositaddr,ptr->jumblraddr,ptr->KMDjumblraddr);
if ( strcmp("KMD",symbol) == 0 )
{
ptr->BTC2KMD = ptr->btcprice;

Loading…
Cancel
Save