|
|
@ -1151,20 +1151,20 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti |
|
|
|
if ( (numspent= LP_spends_set(&rswap)) == 3 ) |
|
|
|
rswap.finishedflag = 1; |
|
|
|
else rswap.finishedflag = basilisk_swap_isfinished(rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent); |
|
|
|
item = LP_swap_json(&rswap); |
|
|
|
if ( rswap.origfinishedflag == 0 && rswap.finishedflag != 0 ) |
|
|
|
{ |
|
|
|
char fname[1024],*itemstr; FILE *fp; |
|
|
|
LP_numfinished++; |
|
|
|
printf("SWAP %u-%u finished LP_numfinished.%d !\n",requestid,quoteid,LP_numfinished); |
|
|
|
if ( rswap.finishtime == 0 ) |
|
|
|
rswap.finishtime = (uint32_t)time(NULL); |
|
|
|
if ( rswap.tradeid != 0 ) |
|
|
|
LP_tradebot_finished(rswap.tradeid,rswap.requestid,rswap.quoteid); |
|
|
|
sprintf(fname,"%s/SWAPS/%u-%u.finished",GLOBAL_DBDIR,rswap.requestid,rswap.quoteid), OS_compatible_path(fname); |
|
|
|
item = LP_swap_json(&rswap); |
|
|
|
if ( (fp= fopen(fname,"wb")) != 0 ) |
|
|
|
{ |
|
|
|
jaddstr(item,"method","tradestatus"); |
|
|
|
if ( rswap.finishtime == 0 ) |
|
|
|
rswap.finishtime = (uint32_t)time(NULL); |
|
|
|
jaddnum(item,"finishtime",rswap.finishtime); |
|
|
|
jaddstr(item,"gui",G.gui); |
|
|
|
//jaddbits256(item,"srchash",rswap.Q.srchash);
|
|
|
@ -1178,7 +1178,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti |
|
|
|
//LP_broadcast_message(LP_mypubsock,rswap.src,rswap.dest,zero,itemstr);
|
|
|
|
fclose(fp); |
|
|
|
} |
|
|
|
} |
|
|
|
} else item = LP_swap_json(&rswap); |
|
|
|
for (i=0; i<sizeof(txnames)/sizeof(*txnames); i++) |
|
|
|
if ( rswap.txbytes[i] != 0 ) |
|
|
|
free(rswap.txbytes[i]), rswap.txbytes[i] = 0; |
|
|
|