Browse Source

Test

etomic
jl777 7 years ago
parent
commit
eb6d6fe7f0
  1. 7
      iguana/exchanges/LP_prices.c
  2. 1
      iguana/exchanges/LP_signatures.c

7
iguana/exchanges/LP_prices.c

@ -106,14 +106,15 @@ void LP_pubkey_update(struct LP_pubkeyinfo *pubp,uint32_t baseind,uint32_t relin
if ( numutxos > (1L << sizeof(pq->numutxos)) )
pq->numutxos = (1L << sizeof(pq->numutxos)) - 1;
else pq->numutxos = numutxos;
aveutxo = balance / numutxos;
aveutxo = (balance + (scale64>>1)) / numutxos;
if ( (ave64= (aveutxo / scale64)) > (1LL << 32) )
ave64 = (1LL << 32) - 1;
if ( (max64= (maxutxo / scale64)) > (1LL << 32) )
max64 = ((maxutxo + (scale64>>1)) / scale64);
if ( max64 > (1LL << 32) )
max64 = (1LL << 32) - 1;
pq->aveutxo = (uint32_t)ave64;
pq->maxutxo = (uint32_t)max64;
printf("scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64);
printf("base.%s scale64 = %llu, ave %llu, ave32 %u (%llu) max32 %u (%llu)\n",LP_priceinfos[baseind].symbol,(long long)scale64,(long long)aveutxo,pq->aveutxo,(long long)pq->aveutxo * scale64,pq->maxutxo,(long long)pq->maxutxo * scale64);
}
}

1
iguana/exchanges/LP_signatures.c

@ -472,6 +472,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re
{
if ( (numutxos= LP_address_minmax(&balance,&minsize,&maxsize,ap)) != 0 )
{
printf("%s numutxos.%d balance %.8f min %.8f max %.8f\n",base,numutxos,dstr(balance),dstr(minsize),dstr(maxsize));
jaddnum(reqjson,"n",numutxos);
jaddnum(reqjson,"bal",dstr(balance));
jaddnum(reqjson,"min",dstr(minsize));

Loading…
Cancel
Save