Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
551d79357f
  1. 5
      iguana/iguana777.c
  2. 5
      iguana/iguana_json.c
  3. 2
      iguana/iguana_msg.c
  4. 4
      iguana/iguana_peers.c
  5. 2
      iguana/iguana_recv.c

5
iguana/iguana777.c

@ -235,6 +235,11 @@ uint32_t iguana_updatemetrics(struct iguana_info *coin)
{ {
expand_ipbits(ipaddr,(uint32_t)addr->ipbits); expand_ipbits(ipaddr,(uint32_t)addr->ipbits);
fprintf(fp,"%s\n",ipaddr); fprintf(fp,"%s\n",ipaddr);
if ( addr->msgcounts.verack == 0 )
{
printf("iguana_sendblockreq (%s) addrind.%d hasn't verack'ed yet\n",addr->ipaddr,addr->addrind);
iguana_send_version(coin,addr,coin->myservices);
}
} }
} }
} }

5
iguana/iguana_json.c

@ -664,8 +664,11 @@ TWO_STRINGS(iguana,addnode,activecoin,ipaddr)
if ( coin != 0 && ipaddr != 0 && is_ipaddr(ipaddr) != 0 ) if ( coin != 0 && ipaddr != 0 && is_ipaddr(ipaddr) != 0 )
{ {
//iguana_possible_peer(coin,ipaddr); //iguana_possible_peer(coin,ipaddr);
if ( (addr= iguana_peerslot(coin,(uint32_t)calc_ipbits(ipaddr),0)) != 0 ) if ( (addr= iguana_peerslot(coin,(uint32_t)calc_ipbits(ipaddr),1)) != 0 )
{ {
addr->supernet = 1;
if ( addr->usock >= 0 )
return(clonestr("{\"result\":\"peer was already connected\"}"));
if ( addr->pending == 0 ) if ( addr->pending == 0 )
{ {
addr->pending = (uint32_t)time(NULL); addr->pending = (uint32_t)time(NULL);

2
iguana/iguana_msg.c

@ -171,7 +171,7 @@ void iguana_gotversion(struct iguana_info *coin,struct iguana_peer *addr,struct
addr->dead = (uint32_t)time(NULL); addr->dead = (uint32_t)time(NULL);
if ( (vers->nServices & (1<<7)) == (1<<7) ) if ( (vers->nServices & (1<<7)) == (1<<7) )
addr->supernet = 1; addr->supernet = 1;
if ( addr->supernet != 0 ) //if ( addr->supernet != 0 )
printf("height.%d nServices.%lld nonce.%llu %srelay node.(%s) supernet.%d\n",vers->nStartingHeight,(long long)vers->nServices,(long long)vers->nonce,addr->relayflag==0?"non-":"",addr->ipaddr,addr->supernet); printf("height.%d nServices.%lld nonce.%llu %srelay node.(%s) supernet.%d\n",vers->nStartingHeight,(long long)vers->nServices,(long long)vers->nonce,addr->relayflag==0?"non-":"",addr->ipaddr,addr->supernet);
if ( (int32_t)vers->nStartingHeight > coin->longestchain ) if ( (int32_t)vers->nStartingHeight > coin->longestchain )
{ {

4
iguana/iguana_peers.c

@ -653,7 +653,7 @@ void iguana_startconnection(void *arg)
if ( addr->usock < 0 || coin->peers.shuttingdown != 0 ) if ( addr->usock < 0 || coin->peers.shuttingdown != 0 )
{ {
strcpy(ipaddr,addr->ipaddr); strcpy(ipaddr,addr->ipaddr);
//printf("refused PEER KILLED. slot.%d for %s:%d usock.%d\n",addr->addrind,ipaddr,coin->chain->portp2p,addr->usock); printf("refused PEER KILLED. slot.%d for %s:%d usock.%d\n",addr->addrind,ipaddr,coin->chain->portp2p,addr->usock);
iguana_iAkill(coin,addr,1); iguana_iAkill(coin,addr,1);
} }
else else
@ -1085,7 +1085,7 @@ void iguana_dedicatedloop(struct supernet_info *myinfo,struct iguana_info *coin,
else else
{ {
iguana_send_version(coin,addr,coin->myservices); iguana_send_version(coin,addr,coin->myservices);
//printf("send version myservices.%llu to (%s)\n",(long long)coin->myservices,addr->ipaddr); printf("send version myservices.%llu to (%s)\n",(long long)coin->myservices,addr->ipaddr);
} }
//sleep(1+(rand()%5)); //sleep(1+(rand()%5));
//iguana_queue_send(coin,addr,0,serialized,"getaddr",0,0,0); //iguana_queue_send(coin,addr,0,serialized,"getaddr",0,0,0);

2
iguana/iguana_recv.c

@ -88,7 +88,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
if ( addr->msgcounts.verack == 0 ) if ( addr->msgcounts.verack == 0 )
{ {
//printf("iguana_sendblockreq (%s) addrind.%d hasn't verack'ed yet\n",addr->ipaddr,addr->addrind); //printf("iguana_sendblockreq (%s) addrind.%d hasn't verack'ed yet\n",addr->ipaddr,addr->addrind);
//iguana_send_version(coin,addr,coin->myservices); iguana_send_version(coin,addr,coin->myservices);
return(-1); return(-1);
} }
lastreq2 = lastreq; lastreq2 = lastreq;

Loading…
Cancel
Save