diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 25bb1ee70..9d0f4ff47 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -260,10 +260,7 @@ bot_resume(botid)\n\ { uint32_t requestid,quoteid; if ( (requestid= juint(argjson,"requestid")) != 0 && (quoteid= juint(argjson,"quoteid")) != 0 ) - { - printf("swapentry %u %u\n",requestid,quoteid); return(basilisk_swapentry(requestid,quoteid)); - } else if ( coin[0] != 0 ) return(basilisk_swapentries(coin,0,jint(argjson,"limit"))); else if ( base[0] != 0 && rel[0] != 0 ) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 5d07367d3..4e3a1e5f2 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -238,7 +238,7 @@ struct LP_swap_remember bits256 pubA0,pubB0,pubB1,privAm,privBn,paymentspent,Apaymentspent,depositspent,myprivs[2],txids[sizeof(txnames)/sizeof(*txnames)]; uint64_t Atxfee,Btxfee,srcamount,destamount,aliceid; int64_t values[sizeof(txnames)/sizeof(*txnames)]; - uint32_t tradeid,requestid,quoteid,plocktime,dlocktime,expiration,state,otherstate; + uint32_t finishtime,tradeid,requestid,quoteid,plocktime,dlocktime,expiration,state,otherstate; int32_t iambob,finishedflag,origfinishedflag,Predeemlen,Dredeemlen,sentflags[sizeof(txnames)/sizeof(*txnames)]; uint8_t secretAm[20],secretAm256[32],secretBn[20],secretBn256[32],Predeemscript[1024],Dredeemscript[1024],pubkey33[33],other33[33]; char src[64],dest[64],destaddr[64],Adestaddr[64],Sdestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 75e582bd0..b50caa432 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -479,9 +479,7 @@ cJSON *LP_swap_json(struct LP_swap_remember *rswap) if ( rswap->finishedflag != 0 ) { jaddstr(item,"status","finished"); - if ( rswap->iambob == 0 ) - jaddnum(item,"finishtime",LP_txtime(rswap->src,rswap->paymentspent)); - else jaddnum(item,"finishtime",LP_txtime(rswap->src,rswap->depositspent)); + jaddnum(item,"finishtime",rswap->finishtime); } else jaddstr(item,"status","pending"); jaddbits256(item,"bobdeposit",rswap->txids[BASILISK_BOBDEPOSIT]); @@ -663,6 +661,7 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap) { if ( (fileobj= cJSON_Parse(fstr)) != 0 ) { + rswap->finishtime = juint(fileobj,"finishtime"); rswap->origfinishedflag = rswap->finishedflag = 1; free_json(fileobj); } @@ -1121,6 +1120,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti if ( (fp= fopen(fname,"wb")) != 0 ) { jaddstr(item,"method","tradestatus"); + jaddnum(item,"finishtime",rswap.finishtime); jaddstr(item,"gui",G.gui); itemstr = jprint(item,0); fprintf(fp,"%s\n",itemstr); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5b2a654ee..1d952ff6d 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -447,7 +447,7 @@ uint32_t LP_locktime(char *symbol,bits256 txid) return(locktime); } -uint32_t LP_txtime(char *symbol,bits256 txid) +/*uint32_t LP_txtime(char *symbol,bits256 txid) { struct LP_transaction *tx; struct iguana_info *coin; int32_t timestamp=0,height = 0; char str[65]; printf("LP_txtime (%s %s)\n",symbol,bits256_str(str,txid)); @@ -462,7 +462,7 @@ uint32_t LP_txtime(char *symbol,bits256 txid) } } return(height); -} +}*/ cJSON *LP_gettxout_json(bits256 txid,int32_t vout,int32_t height,char *coinaddr,uint64_t value) {