From 06a7b4aeda6ce96f4a946f15adb9b0edc13e3bac Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 9 Feb 2018 01:22:23 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_remember.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 8c20ae04d..2912aae0e 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -892,7 +892,17 @@ int32_t LP_spends_set(struct LP_swap_remember *rswap) cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requestid,uint32_t quoteid,int32_t forceflag,int32_t pendingonly) { static void *ctx; - struct LP_swap_remember rswap; int32_t i,j,flag,numspent,len,secretstart,redeemlen; char str[65],*srcAdest,*srcBdest,*destAdest,*destBdest,otheraddr[64]; cJSON *item,*txoutobj; bits256 rev,signedtxid,zero,deadtxid; uint32_t claimtime; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; + struct LP_swap_remember rswap; int32_t i,j,flag,numspent,len,secretstart,redeemlen; char str[65],*srcAdest,*srcBdest,*destAdest,*destBdest,otheraddr[64],*fstr,fname[512]; cJSON *item,*txoutobj,*retjson; bits256 rev,signedtxid,zero,deadtxid; uint32_t claimtime; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; long fsize; + sprintf(fname,"%s/SWAPS/%u-%u.finished",GLOBAL_DBDIR,requestid,quoteid), OS_compatible_path(fname); + if ( (fstr= OS_filestr(&fsize,fname)) != 0 ) + { + if ( (retjson= cJSON_Parse(fstr)) != 0 ) + { + free(fstr); + return(retjson); + } + free(fstr); + } if ( ctx == 0 ) ctx = bitcoin_ctx(); if ( requestid == 0 || quoteid == 0 )