jl777 7 years ago
parent
commit
52b6672cc4
  1. 2
      iguana/exchanges/LP_nativeDEX.c
  2. 2
      iguana/exchanges/LP_ordermatch.c
  3. 3
      iguana/exchanges/LP_rpc.c

2
iguana/exchanges/LP_nativeDEX.c

@ -361,6 +361,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int
memset(&zero,0,sizeof(zero));
if ( coin->inactive != 0 )
continue;
if ( coin->rate == 0. )
LP_getestimatedrate(coin);
if ( (rand() % 1000) == 0 )
{
post = 0;

2
iguana/exchanges/LP_ordermatch.c

@ -460,7 +460,7 @@ int32_t LP_nearest_utxovalue(struct LP_address_utxo **utxos,int32_t n,uint64_t t
uint64_t LP_basesatoshis(double relvolume,double price,uint64_t txfee,uint64_t desttxfee)
{
printf("basesatoshis %.8f (rel %.8f / price %.8f)\n",dstr(SATOSHIDEN * ((relvolume + dstr(desttxfee)) / price) + 2*txfee),relvolume,price);
if ( relvolume > dstr(desttxfee) )
if ( relvolume > dstr(desttxfee) && price > SMALLVAL )
return(SATOSHIDEN * ((relvolume - dstr(desttxfee)) / price));
else return(0);
}

3
iguana/exchanges/LP_rpc.c

@ -617,8 +617,7 @@ double LP_getestimatedrate(struct iguana_info *coin)
rate *= 1.25;
coin->rate = rate;
coin->ratetime = (uint32_t)time(NULL);
if ( (rand() % 10) == 0 )
printf("estimated rate.(%s) (%s) -> %.8f\n",coin->symbol,retstr,rate);
printf("estimated rate.(%s) (%s) -> %.8f\n",coin->symbol,retstr,rate);
}
free(retstr);
}

Loading…
Cancel
Save