Browse Source

Test

etomic
jl777 8 years ago
parent
commit
32c88d96dc
  1. 12
      iguana/exchanges/LP_bitcoin.c
  2. 8
      iguana/exchanges/LP_nativeDEX.c

12
iguana/exchanges/LP_bitcoin.c

@ -26,9 +26,9 @@ bits256 LP_privkeyfind(uint8_t rmd160[20])
for (i=0; i<LP_numprivkeys; i++)
if ( memcmp(rmd160,LP_privkeys[i].rmd160,20) == 0 )
return(LP_privkeys[i].privkey);
for (i=0; i<20; i++)
printf("%02x",rmd160[i]);
printf(" -> no privkey\n");
//for (i=0; i<20; i++)
// printf("%02x",rmd160[i]);
//printf(" -> no privkey\n");
return(zero);
}
@ -40,9 +40,9 @@ int32_t LP_privkeyadd(bits256 privkey,uint8_t rmd160[20])
return(-bits256_cmp(privkey,tmpkey));
LP_privkeys[LP_numprivkeys].privkey = privkey;
memcpy(LP_privkeys[LP_numprivkeys].rmd160,rmd160,20);
int32_t i; for (i=0; i<20; i++)
printf("%02x",rmd160[i]);
char str[65]; printf(" -> add privkey.(%s)\n",bits256_str(str,privkey));
//int32_t i; for (i=0; i<20; i++)
// printf("%02x",rmd160[i]);
//char str[65]; printf(" -> add privkey.(%s)\n",bits256_str(str,privkey));
LP_numprivkeys++;
return(LP_numprivkeys);
}

8
iguana/exchanges/LP_nativeDEX.c

@ -834,6 +834,7 @@ void LP_privkey_updates(struct LP_peerinfo *mypeer,int32_t pubsock,char *passphr
void LP_mainloop(struct LP_peerinfo *mypeer,uint16_t mypubport,int32_t pubsock,int32_t pullsock,uint16_t myport,int32_t amclient,char *passphrase,double profitmargin)
{
static uint16_t tmpport;
char *retstr; uint8_t r; int32_t i,n,j,len,recvsize,counter=0,nonz,lastn; struct LP_peerinfo *peer,*tmp; void *ptr; cJSON *argjson;
if ( amclient == 0 )
{
@ -852,14 +853,15 @@ void LP_mainloop(struct LP_peerinfo *mypeer,uint16_t mypubport,int32_t pubsock,i
i = (r + j) % (sizeof(default_LPnodes)/sizeof(*default_LPnodes));
LP_peersquery(amclient,mypeer,pubsock,default_LPnodes[i],myport,"127.0.0.1",myport,profitmargin);
}
myport += 10;
}
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 )
if ( amclient != 0 )
tmpport = myport + 10;
else tmpport = myport;
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&tmpport) != 0 )
{
printf("error launching stats rpcloop for port.%u\n",myport);
exit(-1);
}
myport -= 10 * amclient;
for (i=0; i<sizeof(activecoins)/sizeof(*activecoins); i++)
LP_coinfind(activecoins[i]);
if ( amclient != 0 )

Loading…
Cancel
Save