From 28b1a35cf7ee2722eedd7d3f7b72ea593cc1dc80 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 17 Jun 2017 19:43:20 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_remember.c | 18 ++++++++++++++++++ iguana/exchanges/LP_swap.c | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index dc02a419b..f5d083594 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -867,6 +867,24 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( finishedflag != 0 ) jaddstr(item,"status","finished"); else jaddstr(item,"status","pending"); + if ( bits256_nonz(paymentspent) == 0 ) + { + if ( bits256_nonz(txids[BASILISK_ALICESPEND]) != 0 ) + paymentspent = txids[BASILISK_ALICESPEND]; + else paymentspent = txids[BASILISK_BOBRECLAIM]; + } + if ( bits256_nonz(depositspent) == 0 ) + { + if ( bits256_nonz(txids[BASILISK_BOBREFUND]) != 0 ) + depositspent = txids[BASILISK_BOBREFUND]; + else depositspent = txids[BASILISK_ALICECLAIM]; + } + if ( bits256_nonz(Apaymentspent) == 0 ) + { + if ( bits256_nonz(txids[BASILISK_BOBSPEND]) != 0 ) + Apaymentspent = txids[BASILISK_BOBSPEND]; + else Apaymentspent = txids[BASILISK_ALICERECLAIM]; + } bits256_str(str,paymentspent), jaddbits256(item,"paymentspent",paymentspent); bits256_str(str,Apaymentspent), jaddbits256(item,"Apaymentspent",Apaymentspent); bits256_str(str,depositspent), jaddbits256(item,"depositspent",depositspent); diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index af26c15fc..44275bbc7 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -644,6 +644,11 @@ int32_t LP_swapwait(uint32_t requestid,uint32_t quoteid,int32_t duration,int32_t { printf("SWAP completed! %u-%u %s\n",requestid,quoteid,jprint(retjson,0)); free_json(retjson); + if ( (retstr= basilisk_swapentry(requestid,quoteid)) != 0 ) + { + printf("second call.(%s)\n",retstr); + free(retstr); + } return(0); } else return(-1); }