From a532a16a382695329889854a240d59056061f526 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 1 Jul 2016 17:01:52 -0300 Subject: [PATCH] test --- basilisk/basilisk_DEX.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/basilisk/basilisk_DEX.c b/basilisk/basilisk_DEX.c index 2b37850b0..b33f7416f 100755 --- a/basilisk/basilisk_DEX.c +++ b/basilisk/basilisk_DEX.c @@ -339,7 +339,7 @@ char *basilisk_respond_swapstatus(struct supernet_info *myinfo,bits256 hash,uint char *basilisk_respond_requests(struct supernet_info *myinfo,bits256 hash,uint32_t requestid,uint32_t quoteid) { - int32_t i,num=0; cJSON *retjson,*array; struct basilisk_request *requests,*rp; uint8_t space[16384]; + int32_t i,qflag,num=0; cJSON *retjson,*array; struct basilisk_request *requests,*rp; uint8_t space[16384]; array = cJSON_CreateArray(); portable_mutex_lock(&myinfo->DEX_reqmutex); if ( (requests= _basilisk_requests_uniq(myinfo,&num,space,sizeof(space))) != 0 ) @@ -347,7 +347,10 @@ char *basilisk_respond_requests(struct supernet_info *myinfo,bits256 hash,uint32 for (i=0; irequestid == requestid) && (quoteid == 0 || quoteid == rp->quoteid) && (bits256_cmp(hash,rp->hash) == 0 || bits256_cmp(hash,rp->desthash) == 0) ) + if ( quoteid == 0 || (quoteid == rp->quoteid && (bits256_cmp(hash,rp->hash) == 0 || bits256_cmp(hash,rp->desthash) == 0)) ) + qflag = 1; + else qflag = 0; + if ( requestid == 0 || (rp->requestid == requestid && qflag != 0) ) jaddi(array,basilisk_requestjson(rp->relaybits,rp)); } }