From fb234e40e7655a219ad53ab35048c92662af7951 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 24 Aug 2017 18:12:25 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_scan.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 3192c0d51..e1fbfdceb 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -351,7 +351,7 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height) char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) { - cJSON *array,*retjson,*item,*child,*exclude=0; int32_t i,j,n,execflag=0,flag,iter,numexcluded=0; char buf[1024],*field,*prefix="",*suffix=""; uint64_t dustsum=0,excluded=0,total=0,dividend=0,value,val,emit=0,dust=0; double ratio = 1.; + cJSON *array,*retjson,*item,*child,*exclude=0; int32_t i,j,dusted=0,n,execflag=0,flag,iter,numexcluded=0; char buf[1024],*field,*prefix="",*suffix=""; uint64_t dustsum=0,excluded=0,total=0,dividend=0,value,val,emit=0,dust=0; double ratio = 1.; if ( (retjson= LP_snapshot(coin,height)) != 0 ) { //printf("SNAPSHOT.(%s)\n",retstr); @@ -400,7 +400,7 @@ char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) if ( flag == 0 ) { val = ratio * value; - if ( val > dust ) + if ( val >= dust ) { sprintf(buf,"%s %s %.8f %s",prefix,field,dstr(val),suffix); if ( execflag != 0 ) @@ -410,7 +410,7 @@ char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) } else printf("%s\n",buf); emit += val; - } else dustsum += val; + } else dustsum += val, dusted++; } } } @@ -434,7 +434,10 @@ char *LP_dividends(struct iguana_info *coin,int32_t height,cJSON *argjson) jaddnum(retjson,"total",dstr(total)); jaddnum(retjson,"excluded",dstr(excluded)); if ( dust != 0 ) + { jaddnum(retjson,"dust",dstr(dust)); + jaddnum(retjson,"dusted",dusted); + } if ( dustsum != 0 ) jaddnum(retjson,"dustsum",dstr(dustsum)); jaddnum(retjson,"dividend",dstr(dividend));