From 719df185e0403916d3034c0a251a548936db3118 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 7 Feb 2018 21:59:42 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_remember.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index b8597cbd4..a5ccda267 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -935,6 +935,16 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti jaddnum(retjson,"quoteid",quoteid); return(retjson); } + if ( alice->lastscanht < alice->longestchain+1 ) + { + printf("need to scan %s first\n",alice->symbol); + cJSON *retjson = cJSON_CreateObject(); + jaddstr(retjson,"error","need to scan coin first"); + jaddstr(retjson,"coin",alice->symbol); + jaddnum(retjson,"requestid",requestid); + jaddnum(retjson,"quoteid",quoteid); + return(retjson); + } } if ( (bob= LP_coinfind(rswap.bobcoin)) != 0 ) { @@ -959,6 +969,16 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti jaddnum(retjson,"quoteid",quoteid); return(retjson); } + if ( bob->lastscanht < bob->longestchain+1 ) + { + printf("need to scan %s first\n",bob->symbol); + cJSON *retjson = cJSON_CreateObject(); + jaddstr(retjson,"error","need to scan coin first"); + jaddstr(retjson,"coin",bob->symbol); + jaddnum(retjson,"requestid",requestid); + jaddnum(retjson,"quoteid",quoteid); + return(retjson); + } } if ( (alice= LP_coinfind(rswap.alicecoin)) != 0 ) {