From 2afdf22044897004bd71ba4d828e466840ffe1dd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 16 Apr 2017 21:09:33 +0300 Subject: [PATCH] Test --- basilisk/basilisk_swap.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/basilisk/basilisk_swap.c b/basilisk/basilisk_swap.c index 2c04497f3..3f1cb8997 100755 --- a/basilisk/basilisk_swap.c +++ b/basilisk/basilisk_swap.c @@ -3649,7 +3649,7 @@ cJSON *basilisk_remember(struct supernet_info *myinfo,int64_t *KMDtotals,int64_t char *basilisk_swaplist(struct supernet_info *myinfo) { - char fname[512]; FILE *fp; cJSON *item,*retjson,*array,*totalsobj; uint32_t quoteid,requestid; int64_t KMDtotals[16],BTCtotals[16]; int32_t i; + char fname[512]; FILE *fp; cJSON *item,*retjson,*array,*totalsobj; uint32_t quoteid,requestid; int64_t KMDtotals[16],BTCtotals[16],Btotal,Ktotal; int32_t i; memset(KMDtotals,0,sizeof(KMDtotals)); memset(BTCtotals,0,sizeof(BTCtotals)); //,statebits; int32_t optionduration; struct basilisk_request R; bits256 privkey; @@ -3682,15 +3682,21 @@ char *basilisk_swaplist(struct supernet_info *myinfo) if ( cJSON_GetArraySize(array) > 0 ) { totalsobj = cJSON_CreateObject(); - for (i=0; i 0 && Btotal < 0 ) + jaddnum(retjson,"avebuy",(double)-Btotal/Ktotal); + else if ( Ktotal < 0 && Btotal > 0 ) + jaddnum(retjson,"avesell",(double)-Btotal/Ktotal); } array = cJSON_CreateArray(); for (i=0; ilinfos)/sizeof(*myinfo->linfos); i++)