Browse Source

Merge pull request #496 from jl777/spvdex

remove print, improve peer propagation
etomic
jl777 7 years ago
committed by GitHub
parent
commit
d6e7dbae4a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      iguana/exchanges/LP_peers.c
  2. 2
      iguana/exchanges/LP_signatures.c
  3. 2
      iguana/exchanges/stats.c

6
iguana/exchanges/LP_peers.c

@ -212,8 +212,8 @@ void LP_peer_recv(char *ipaddr,int32_t ismine)
if ( (peer= LP_peerfind((uint32_t)calc_ipbits(ipaddr),RPC_port)) != 0 )
{
peer->numrecv++;
if ( ismine != 0 )
peer->recvtime = (uint32_t)time(NULL);
//if ( ismine != 0 )
peer->recvtime = (uint32_t)time(NULL);
}
}
@ -262,7 +262,7 @@ uint16_t LP_rarestpeer(char *destip)
{
HASH_ITER(hh,LP_peerinfos,peer,tmp)
{
if ( iter == 0 && peer->recvtime < now-3600*24 )
if ( strcmp(peer->ipaddr,LP_myipaddr) != 0 && iter == 0 && peer->recvtime < now-3600 )
continue;
if ( peer->isLP != 0 )
{

2
iguana/exchanges/LP_signatures.c

@ -611,7 +611,7 @@ char *LP_notify_recv(cJSON *argjson)
LP_pubkey_sigcheck(pubp,argjson);
if ( (ipaddr= jstr(argjson,"isLP")) != 0 )
{
//printf("notify got isLP %s %d\n",ipaddr,jint(argjson,"ismine"));
printf("notify got isLP %s %d\n",ipaddr,jint(argjson,"ismine"));
LP_peer_recv(ipaddr,jint(argjson,"ismine"));
if ( IAMLP != 0 && G.LP_IAMLP == 0 && strcmp(ipaddr,LP_myipaddr) == 0 )
{

2
iguana/exchanges/stats.c

@ -710,7 +710,7 @@ void LP_rpc_processreq(void *_ptr)
else
{
response = malloc(strlen(retstr)+1024+1+1);
printf("alloc response.%p\n",response);
//printf("alloc response.%p\n",response);
}
sprintf(hdrs,"HTTP/1.1 200 OK\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Methods: GET, POST\r\nCache-Control : no-cache, no-store, must-revalidate\r\n%sContent-Length : %8d\r\n\r\n",content_type,(int32_t)strlen(retstr));
response[0] = '\0';

Loading…
Cancel
Save