Browse Source

Test

etomic
jl777 8 years ago
parent
commit
aa3d38739b
  1. 13
      iguana/exchanges/LP_nativeDEX.c
  2. 2
      iguana/exchanges/LP_utxos.c

13
iguana/exchanges/LP_nativeDEX.c

@ -173,7 +173,7 @@ void LP_utxo_updates(int32_t pubsock,char *passphrase,double profitmargin)
void LP_mainloop(char *myipaddr,struct LP_peerinfo *mypeer,uint16_t mypubport,int32_t pubsock,char *pushaddr,int32_t pullsock,uint16_t myport,char *passphrase,double profitmargin,cJSON *coins) void LP_mainloop(char *myipaddr,struct LP_peerinfo *mypeer,uint16_t mypubport,int32_t pubsock,char *pushaddr,int32_t pullsock,uint16_t myport,char *passphrase,double profitmargin,cJSON *coins)
{ {
char *retstr; uint8_t r; int32_t i,n,j,counter=0,nonz,lastn; struct LP_peerinfo *peer,*tmp; uint32_t now,lastforward = 0; cJSON *item; char *retstr; uint8_t r; int32_t i,n,j,counter=0,nonz,lastn; struct LP_peerinfo *peer,*tmp; uint32_t now,lastforward = 0; cJSON *item; struct LP_utxoinfo *utxo,*utmp;
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 )
{ {
printf("error launching stats rpcloop for port.%u\n",myport); printf("error launching stats rpcloop for port.%u\n",myport);
@ -288,6 +288,17 @@ void LP_mainloop(char *myipaddr,struct LP_peerinfo *mypeer,uint16_t mypubport,in
} }
nonz += LP_subsock_check(peer); nonz += LP_subsock_check(peer);
} }
if ( (counter % 100) == 0 )
{
HASH_ITER(hh,LP_utxoinfos[0],utxo,utmp)
{
LP_utxo_spentcheck(pubsock,utxo,profitmargin);
}
HASH_ITER(hh,LP_utxoinfos[1],utxo,utmp)
{
LP_utxo_spentcheck(pubsock,utxo,profitmargin);
}
}
if ( pullsock >= 0 ) if ( pullsock >= 0 )
nonz += LP_pullsock_check(myipaddr,pubsock,pullsock,profitmargin); nonz += LP_pullsock_check(myipaddr,pubsock,pullsock,profitmargin);
if ( nonz == 0 ) if ( nonz == 0 )

2
iguana/exchanges/LP_utxos.c

@ -630,7 +630,7 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr
bits256 LP_privkeycalc(uint8_t *pubkey33,bits256 *pubkeyp,struct iguana_info *coin,char *passphrase,char *wifstr) bits256 LP_privkeycalc(uint8_t *pubkey33,bits256 *pubkeyp,struct iguana_info *coin,char *passphrase,char *wifstr)
{ {
static uint32_t counter; static uint32_t counter;
bits256 privkey,userpub,userpass; char tmpstr[128],str[65],str2[65]; cJSON *retjson; uint8_t tmptype,rmd160[20]; bits256 privkey,userpub,userpass; char tmpstr[128]; cJSON *retjson; uint8_t tmptype,rmd160[20];
if ( passphrase != 0 && passphrase[0] != 0 ) if ( passphrase != 0 && passphrase[0] != 0 )
conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase));
else else

Loading…
Cancel
Save