|
|
@ -509,14 +509,18 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) |
|
|
|
return(posted); |
|
|
|
} |
|
|
|
|
|
|
|
void LP_coinsloop(void *myipaddr) |
|
|
|
void LP_coinsloop(void *_coins) |
|
|
|
{ |
|
|
|
struct iguana_info *coin,*ctmp; bits256 zero; int32_t j,nonz; |
|
|
|
struct iguana_info *coin,*ctmp; bits256 zero; int32_t j,nonz; char *coins = _coins; |
|
|
|
while ( 1 ) |
|
|
|
{ |
|
|
|
nonz = 0; |
|
|
|
HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht
|
|
|
|
{ |
|
|
|
if ( coins[0] != 0 && strcmp(coins,coin->symbol) != 0 ) |
|
|
|
continue; |
|
|
|
else if ( strcmp("BTC",coin->symbol) == 0 ) |
|
|
|
continue; |
|
|
|
memset(&zero,0,sizeof(zero)); |
|
|
|
if ( coin->inactive != 0 ) |
|
|
|
continue; |
|
|
@ -547,7 +551,7 @@ void LP_coinsloop(void *myipaddr) |
|
|
|
continue; |
|
|
|
} |
|
|
|
//if ( (coin->lastscanht % 1000) == 0 )
|
|
|
|
printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); |
|
|
|
printf("[%s]: %s ref.%d scan.%d to %d, longest.%d\n",coins,coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); |
|
|
|
for (j=0; j<1; j++) |
|
|
|
{ |
|
|
|
if ( LP_blockinit(coin,coin->lastscanht) < 0 ) |
|
|
@ -910,7 +914,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu |
|
|
|
LP_initcoins(ctx,pubsock,coinsjson); |
|
|
|
G.waiting = 1; |
|
|
|
LP_passphrase_init(passphrase,jstr(argjson,"gui")); |
|
|
|
if ( IAMLP != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_psockloop,(void *)&myipaddr) != 0 ) |
|
|
|
if ( IAMLP != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_psockloop,(void *)myipaddr) != 0 ) |
|
|
|
{ |
|
|
|
printf("error launching LP_psockloop for (%s)\n",myipaddr); |
|
|
|
exit(-1); |
|
|
@ -930,27 +934,32 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu |
|
|
|
printf("error launching stats rpcloop for port.%u\n",myport); |
|
|
|
exit(-1); |
|
|
|
} |
|
|
|
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)&myipaddr) != 0 ) |
|
|
|
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)command_rpcloop,(void *)myipaddr) != 0 ) |
|
|
|
{ |
|
|
|
printf("error launching command_rpcloop for port.%u\n",myport); |
|
|
|
exit(-1); |
|
|
|
} |
|
|
|
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)&myipaddr) != 0 ) |
|
|
|
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)queue_loop,(void *)myipaddr) != 0 ) |
|
|
|
{ |
|
|
|
printf("error launching queue_loop for port.%u\n",myport); |
|
|
|
exit(-1); |
|
|
|
} |
|
|
|
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,(void *)&myipaddr) != 0 ) |
|
|
|
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)prices_loop,(void *)myipaddr) != 0 ) |
|
|
|
{ |
|
|
|
printf("error launching prices_loop for port.%u\n",myport); |
|
|
|
exit(-1); |
|
|
|
} |
|
|
|
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)&myipaddr) != 0 ) |
|
|
|
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"") != 0 ) |
|
|
|
{ |
|
|
|
printf("error launching LP_coinsloop for port.%u\n",myport); |
|
|
|
exit(-1); |
|
|
|
} |
|
|
|
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)&myipaddr) != 0 ) |
|
|
|
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_coinsloop,(void *)"BTC") != 0 ) |
|
|
|
{ |
|
|
|
printf("error launching BTC LP_coinsloop for port.%u\n",myport); |
|
|
|
exit(-1); |
|
|
|
} |
|
|
|
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_pubkeysloop,(void *)myipaddr) != 0 ) |
|
|
|
{ |
|
|
|
printf("error launching LP_pubkeysloop for ctx.%p\n",ctx); |
|
|
|
exit(-1); |
|
|
|