Browse Source

Test

etomic
jl777 8 years ago
parent
commit
cbf1699ee6
  1. 23
      iguana/exchanges/LP_remember.c
  2. 2
      iguana/exchanges/LP_socket.c
  3. 2
      iguana/exchanges/mm.c

23
iguana/exchanges/LP_remember.c

@ -663,6 +663,16 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap)
{
int32_t i,needflag,addflag; long fsize; char fname[1024],str[65],*fstr,*symbol,*rstr; cJSON *txobj,*sentobj,*fileobj; bits256 txid,checktxid; uint64_t value;
rswap->iambob = -1;
sprintf(fname,"%s/SWAPS/%u-%u.finished",GLOBAL_DBDIR,rswap->requestid,rswap->quoteid), OS_compatible_path(fname);
if ( (fstr= OS_filestr(&fsize,fname)) != 0 )
{
if ( (fileobj= cJSON_Parse(fstr)) != 0 )
{
rswap->origfinishedflag = rswap->finishedflag = 1;
free_json(fileobj);
}
free(fstr);
}
for (i=0; i<sizeof(txnames)/sizeof(*txnames); i++)
{
needflag = addflag = 0;
@ -748,8 +758,7 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap)
}
free_json(sentobj);
}
if ( 0 && rswap->finishedflag == 0 )
printf("%s %s %.8f\n",txnames[i],bits256_str(str,txid),dstr(value));
printf("%s %s %.8f\n",txnames[i],bits256_str(str,txid),dstr(value));
}
}
} //else printf("no symbol\n");
@ -765,16 +774,6 @@ int32_t LP_swap_load(struct LP_swap_remember *rswap)
strcpy(rswap->src,rswap->bobcoin);
if ( rswap->dest[0] == 0 )
strcpy(rswap->dest,rswap->alicecoin);
sprintf(fname,"%s/SWAPS/%u-%u.finished",GLOBAL_DBDIR,rswap->requestid,rswap->quoteid), OS_compatible_path(fname);
if ( (fstr= OS_filestr(&fsize,fname)) != 0 )
{
if ( (fileobj= cJSON_Parse(fstr)) != 0 )
{
rswap->origfinishedflag = rswap->finishedflag = 1;
free_json(fileobj);
}
free(fstr);
}
return(rswap->finishedflag);
}

2
iguana/exchanges/LP_socket.c

@ -909,7 +909,7 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port)
}
else
{
printf("launched.(%s:%u)\n",ep->ipaddr,ep->port);
printf("launched electrum.(%s:%u)\n",ep->ipaddr,ep->port);
jaddstr(retjson,"result","success");
ep->prev = coin->electrum;
coin->electrum = ep;

2
iguana/exchanges/mm.c

@ -880,7 +880,7 @@ int main(int argc, const char * argv[])
{
printf("error launching LP_main (%s)\n",jprint(retjson,0));
exit(-1);
} else printf("(%s) launched.(%s)\n",argv[1],passphrase);
} //else printf("(%s) launched.(%s)\n",argv[1],passphrase);
incr = 100.;
while ( (1) )
sleep(1);

Loading…
Cancel
Save