Browse Source

test

etomic
jl777 8 years ago
parent
commit
580bd63517
  1. 2
      basilisk/basilisk_DEX.c
  2. 3
      basilisk/basilisk_swap.c
  3. 6
      basilisk/tradebots_liquidity.c
  4. 4
      iguana/dpow/dpow_network.c

2
basilisk/basilisk_DEX.c

@ -264,7 +264,7 @@ void basilisk_requests_poll(struct supernet_info *myinfo)
//printf("Call incoming\n");
if ( (retstr= InstantDEX_incoming(myinfo,0,0,0,0)) != 0 )
{
//printf("poll.(%s)\n",retstr);
printf("poll.(%s)\n",retstr);
if ( (retjson= cJSON_Parse(retstr)) != 0 )
{
if ( (outerarray= jarray(&n,retjson,"responses")) != 0 )

3
basilisk/basilisk_swap.c

@ -1023,6 +1023,8 @@ void basilisk_rawtx_setparms(char *name,struct supernet_info *myinfo,struct basi
int32_t bitcoin_coinptrs(struct supernet_info *myinfo,struct iguana_info **bobcoinp,struct iguana_info **alicecoinp,char *src,char *dest,bits256 srchash,bits256 desthash)
{
struct iguana_info *coin = iguana_coinfind(src);
if ( coin == 0 || iguana_coinfind(dest) == 0 )
return(0);
*bobcoinp = *alicecoinp = 0;
if ( strcmp("BTC",src) == 0 || coin->notarychain >= 0 )
{
@ -1863,6 +1865,7 @@ void basilisk_swaploop(void *_swap)
struct basilisk_swap *basilisk_thread_start(struct supernet_info *myinfo,struct basilisk_request *rp,uint32_t statebits,int32_t optionduration)
{
int32_t i,m,n; uint32_t channel,starttime; cJSON *retarray,*item,*msgobj; struct basilisk_swap *swap = 0;
printf("basilisk_thread_start\n");
portable_mutex_lock(&myinfo->DEX_swapmutex);
for (i=0; i<myinfo->numswaps; i++)
if ( myinfo->swaps[i]->I.req.requestid == rp->requestid )

6
basilisk/tradebots_liquidity.c

@ -1000,7 +1000,7 @@ double _default_liquidity_active(struct supernet_info *myinfo,double *refpricep,
{
int32_t i,dir; struct liquidity_info refli;
*refpricep = 0.;
//printf("%s %s/%s\n",exchange,base,rel);
printf("_default_liquidity_active %s %s/%s\n",exchange,base,rel);
for (i=0; i<sizeof(myinfo->linfos)/sizeof(*myinfo->linfos); i++)
{
refli = myinfo->linfos[i];
@ -1013,10 +1013,10 @@ double _default_liquidity_active(struct supernet_info *myinfo,double *refpricep,
else dir = 0;
if ( exchange[0] != 0 && refli.exchange[0] != 0 && strcmp(exchange,refli.exchange) != 0 )
{
//printf("continue %s %s/%s [%d] dir.%d refli.dir %d vs %s %s/%s\n",exchange,base,rel,i,dir,refli.dir,refli.exchange,refli.base,refli.rel);
printf("continue %s %s/%s [%d] dir.%d vs %s %s/%s\n",exchange,base,rel,i,dir,refli.exchange,refli.base,refli.rel);
continue;
}
//printf(">>>>>>>> %s %s/%s [%d] dir.%d refli.dir %d vs %s/%s\n",exchange,base,rel,i,dir,refli.dir,refli.base,refli.rel);
printf(">>>>>>>> %s %s/%s [%d] dir.%d vs %s/%s\n",exchange,base,rel,i,dir,refli.base,refli.rel);
if ( _default_volume_ok(myinfo,&refli,dir,volume) == 0 )
{
if ( refli.profit != 0. )

4
iguana/dpow/dpow_network.c

@ -169,7 +169,7 @@ void dex_packet(struct supernet_info *myinfo,struct dex_nanomsghdr *dexp,int32_t
char *retstr; int32_t datalen; struct iguana_info *coin; struct dex_request dexreq;
//for (i=0; i<size; i++)
// printf("%02x",((uint8_t *)dexp)[i]);
printf(" uniq DEX_PACKET.[%d] crc.%x lag.%d (%d %d)\n",size,calc_crc32(0,dexp->packet,dexp->datalen),(int32_t)(time(NULL)-dexp->timestamp),dexp->size,dexp->datalen);
printf(" uniq.%s DEX_PACKET.[%d] crc.%x lag.%d (%d %d)\n",dexp->handler,size,calc_crc32(0,dexp->packet,dexp->datalen),(int32_t)(time(NULL)-dexp->timestamp),dexp->size,dexp->datalen);
if ( strcmp(dexp->handler,"DEX") == 0 )//dexp->datalen > BASILISK_KEYSIZE )
{
if ( (retstr= basilisk_respond_addmessage(myinfo,dexp->packet,BASILISK_KEYSIZE,&dexp->packet[BASILISK_KEYSIZE],dexp->datalen-BASILISK_KEYSIZE,0,BASILISK_DEXDURATION)) != 0 )
@ -204,7 +204,7 @@ char *_dex_reqsend(struct supernet_info *myinfo,char *handler,uint8_t *data,int3
{
timeout = 100;
nn_setsockopt(reqsock,NN_SOL_SOCKET,NN_SNDTIMEO,&timeout,sizeof(timeout));
timeout = 2000;
timeout = 500;
nn_setsockopt(reqsock,NN_SOL_SOCKET,NN_RCVTIMEO,&timeout,sizeof(timeout));
//nn_setsockopt(reqsock,NN_TCP,NN_RECONNECT_IVL,&timeout,sizeof(timeout));
if ( myinfo->IAMNOTARY == 0 && subsock < 0 && (subsock= nn_socket(AF_SP,NN_SUB)) >= 0 )

Loading…
Cancel
Save