Browse Source

Test

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

13
iguana/exchanges/LP_nativeDEX.c

@ -190,7 +190,7 @@ void LP_utxo_spentcheck(int32_t pubsock,struct LP_utxoinfo *utxo,double profitma
void LP_myutxo_updates(int32_t pubsock,char *passphrase,double profitmargin)
{
//LP_utxopurge(0); not good to disrupt existing pointers
LP_privkey_updates(pubsock,passphrase);
LP_privkey_updates(pubsock,passphrase,0);
}
void LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pubsock,struct LP_peerinfo *peer,uint32_t now,double profitmargin,int32_t interval)
@ -376,11 +376,6 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,double profit
nn_setsockopt(pullsock,NN_SOL_SOCKET,NN_RCVBUF,&maxsize,sizeof(maxsize));
}
}
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);
exit(-1);
}
if ( IAMLP != 0 )
{
if ( myipaddr != 0 )
@ -416,6 +411,12 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,double profit
printf("couldnt get myipaddr\n");
exit(-1);
}
LP_privkey_updates(pubsock,passphrase,1);
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);
exit(-1);
}
LP_mainloop(myipaddr,mypeer,mypubport,pubsock,pushaddr,pullsock,myport,passphrase,profitmargin,jobj(argjson,"coins"),jstr(argjson,"seednode"));
}

4
iguana/exchanges/LP_utxos.c

@ -756,7 +756,7 @@ bits256 LP_privkeycalc(uint8_t *pubkey33,bits256 *pubkeyp,struct iguana_info *co
return(privkey);
}
void LP_privkey_updates(int32_t pubsock,char *passphrase)
void LP_privkey_updates(int32_t pubsock,char *passphrase,int32_t initonly)
{
int32_t i; struct iguana_info *coin; bits256 pubkey,privkey; uint8_t pubkey33[33];
memset(privkey.bytes,0,sizeof(privkey));
@ -768,7 +768,7 @@ void LP_privkey_updates(int32_t pubsock,char *passphrase)
{
if ( bits256_nonz(privkey) == 0 || coin->smartaddr[0] == 0 )
privkey = LP_privkeycalc(pubkey33,&pubkey,coin,passphrase,"");
if ( coin->inactive == 0 )
if ( coin->inactive == 0 && initonly == 0 )
LP_privkey_init(pubsock,coin,privkey,pubkey,pubkey33);
}
}

Loading…
Cancel
Save