Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
69f7872816
  1. 157
      iguana/confs/BTCD_peers.txt
  2. 13
      iguana/iguana_init.c
  3. 7
      iguana/iguana_peers.c

157
iguana/confs/BTCD_peers.txt

@ -7,84 +7,79 @@
89.248.160.243 89.248.160.243
89.248.160.244 89.248.160.244
89.248.160.245 89.248.160.245
85.25.217.233 5.9.102.210
65.15.37.140 78.47.196.146
62.75.145.171 85.25.217.233:14631
176.9.13.13 88.198.53.194:55692
88.198.15.19 88.206.186.58:37299
51.255.38.28 162.255.117.105:63084
121.108.241.247 115.28.42.60:60878
82.229.201.131 82.176.15.155:35026
162.13.4.69 88.198.15.19:48150
78.226.160.96 176.9.13.13:14631
115.28.42.60 217.8.62.188:52714
178.62.185.131 162.13.4.69:55410
167.114.249.196 211.58.177.43:35581
81.181.155.53 63.247.147.166:50266
76.169.236.235 24.168.17.50:50793
67.165.77.192 46.231.137.186:56963
75.130.163.51 178.62.185.131:35572
72.55.148.203 62.75.145.171:14631
96.127.136.18 89.212.19.49:48018
88.198.53.194 192.99.233.217:42232
63.247.147.166 68.190.213.46:14631
88.206.186.58 162.210.92.46:14631
217.8.62.188 98.118.105.12:60805
46.231.137.186 75.130.163.51:56719
217.215.190.134 51.255.38.28:14631
2.86.63.69 88.110.117.18:52158
59.147.43.232 24.101.114.249:55457
104.42.224.48 99.44.222.86:62377
24.168.17.50 108.61.166.209:58365
173.65.129.85 98.208.113.72:62065
84.119.62.223 72.133.226.130:14631
59.147.43.232 5.189.144.97:58243
2.239.61.146 14.203.46.202:57987
176.28.45.179 98.202.147.55:60460
73.211.90.130 24.45.172.109:14631
185.48.78.78 89.114.38.65:52768
77.21.104.176 68.59.64.126:50633
46.253.169.134 68.43.220.127:4303
163.172.156.107 81.205.30.207:63077
74.120.222.234 113.87.28.142:62764
192.99.233.217 73.211.90.130:41271
162.255.117.105 110.174.129.213:49252
188.166.91.37 68.45.147.145:57803
149.56.122.72 95.232.175.161:62633
71.1.13.122 73.229.133.160:38440
88.113.76.138 124.191.14.253:54342
81.205.30.207 167.114.249.196:52705
203.189.127.54 92.24.168.248:52892
68.190.213.46 93.158.216.201:14631
98.202.147.55 158.69.27.82:46643
89.212.19.49 104.204.109.11:63390
162.210.92.46 68.157.88.187:56711
115.70.19.28 71.53.152.87:5234
68.43.220.127 82.229.201.131:63466
79.227.171.148 59.147.42.146:57461
68.46.103.181 81.0.91.211:53187
98.207.117.83 82.241.71.230:51945
79.200.255.204 108.247.198.39:64094
82.8.59.60 77.22.227.8:65093
71.241.204.215 122.166.169.11:49325
108.247.198.39 173.76.182.122:14631
156.57.141.221 173.24.82.253:14631
92.26.168.113 100.13.54.119:14631
71.53.157.49 2.26.181.208:14631
68.45.147.145 94.242.213.3:14631
79.54.185.53 87.149.45.42:36077
110.202.11.148 98.207.117.83:50955
91.82.171.9 71.1.8.48:14631
74.14.104.167 71.1.8.48:50439
95.116.195.148 101.166.241.31:14631
90.113.82.59 178.143.154.142:27497
98.118.105.12 103.255.7.59:58660
82.241.71.230 156.57.132.119:62428
98.161.16.55 60.225.171.82:36834
89.248.160.237 46.223.149.120:43358
93.211.231.89 37.157.215.75:4162
2.26.181.156
89.248.160.244
89.248.160.243
89.248.160.242
89.248.160.241

13
iguana/iguana_init.c

@ -302,7 +302,7 @@ void iguana_parseline(struct supernet_info *myinfo,struct iguana_info *coin,int3
//printf("parse line.(%s) maxpeers.%d\n",line,coin->MAXPEERS); //printf("parse line.(%s) maxpeers.%d\n",line,coin->MAXPEERS);
if ( iter == 0 ) if ( iter == 0 )
{ {
if ( (rand() % 2) == 0 && m < coin->MAXPEERS/2 ) if ( m < coin->MAXPEERS/2 )
{ {
if ( 0 && m == 0 ) if ( 0 && m == 0 )
{ {
@ -312,10 +312,13 @@ void iguana_parseline(struct supernet_info *myinfo,struct iguana_info *coin,int3
iguana_launch(coin,"connection",iguana_startconnection,addr,IGUANA_CONNTHREAD); iguana_launch(coin,"connection",iguana_startconnection,addr,IGUANA_CONNTHREAD);
} }
#ifndef IGUANA_DISABLEPEERS #ifndef IGUANA_DISABLEPEERS
addr = &coin->peers->active[m++]; //if ( (rand() % 2) == 0 )
iguana_initpeer(coin,addr,(uint32_t)calc_ipbits(line)); {
//printf("call initpeer.(%s)\n",addr->ipaddr); addr = &coin->peers->active[m++];
iguana_launch(coin,"connection",iguana_startconnection,addr,IGUANA_CONNTHREAD); iguana_initpeer(coin,addr,(uint32_t)calc_ipbits(line));
//printf("call initpeer.(%s)\n",addr->ipaddr);
iguana_launch(coin,"connection",iguana_startconnection,addr,IGUANA_CONNTHREAD);
} //else iguana_possible_peer(coin,line);
#endif #endif
} }
} }

7
iguana/iguana_peers.c

@ -392,6 +392,8 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port)
timeout.tv_sec = 0; timeout.tv_sec = 0;
timeout.tv_usec = 30000; timeout.tv_usec = 30000;
setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout));
timeout.tv_sec = 0;
timeout.tv_usec = 10000;
setsockopt(sock,SOL_SOCKET,SO_SNDTIMEO,(void *)&timeout,sizeof(timeout)); setsockopt(sock,SOL_SOCKET,SO_SNDTIMEO,(void *)&timeout,sizeof(timeout));
} }
opt = 0; opt = 0;
@ -506,14 +508,13 @@ int32_t iguana_send(struct iguana_info *coin,struct iguana_peer *addr,uint8_t *s
//sleep(1); //sleep(1);
//continue; //continue;
} }
printf("send errno.%d %s\n",errno,strerror(errno)); //if ( errno != EAGAIN && errno != EWOULDBLOCK )
if ( errno != EAGAIN && errno != EWOULDBLOCK )
{ {
printf("%s: %s numsent.%d vs remains.%d len.%d errno.%d (%s) usock.%d\n",serialized+4,addr->ipaddr,numsent,remains,len,errno,strerror(errno),addr->usock); printf("%s: %s numsent.%d vs remains.%d len.%d errno.%d (%s) usock.%d\n",serialized+4,addr->ipaddr,numsent,remains,len,errno,strerror(errno),addr->usock);
printf("bad errno.%d %s zombify.%p\n",errno,strerror(errno),&addr->dead); printf("bad errno.%d %s zombify.%p\n",errno,strerror(errno),&addr->dead);
addr->dead = (uint32_t)time(NULL); addr->dead = (uint32_t)time(NULL);
return(-errno); return(-errno);
} //else usleep(*sleeptimep), *sleeptimep *= 1.1; }
} }
else if ( remains > 0 ) else if ( remains > 0 )
{ {

Loading…
Cancel
Save