Browse Source

Test

etomic
jl777 7 years ago
parent
commit
88243c22f7
  1. 3
      iguana/exchanges/LP_commands.c
  2. 2
      iguana/exchanges/LP_include.h
  3. 6
      iguana/exchanges/LP_remember.c
  4. 4
      iguana/exchanges/LP_rpc.c

3
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 )

2
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)];

6
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);

4
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)
{

Loading…
Cancel
Save