问题描述

节点进程起来后,同其他的节点连接失败。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2017-11-14 08:03:36 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:37 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:38 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:39 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:40 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:41 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:42 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:43 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:44 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:44 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:45 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:46 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:47 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:48 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:49 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:50 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:51 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:52 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:53 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:54 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:55 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:56 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:57 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:58 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:03:59 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:04:00 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:04:01 connect() to 104.236.211.206:19335 failed after select(): Connection refused (111)
2017-11-14 08:04:02 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:04:02 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:04:03 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)
2017-11-14 08:04:04 connect() to 66.178.182.35:19335 failed after select(): Connection refused (111)

这样导致比特币或者莱特币帐本不能同步到本地,同时交易也无法发出,节点无法工作。

问题原因

问题原因直接是本地节点与其他节点建立TCP连接建立失败。连接建立失败的原因有很多种,这里列举如下:

  1. 对端拒绝连接,如建立连接太多
  2. 中间网络设备作NAT导致
  3. 网络报文遇到攻击与修改

由于这些原因都不是本节点的原因,属于外部不可控的因素,所以不能希望找到上面的具体原因来解决问题。

解决办法

先了解一下bitcoin比特币节点之间如何建立连接。

这里第一个遇到问题,这些需要连接的节点有哪些来源?

  1. 地址数据库peers.dat
  2. 用户指定地址
  3. DNS查找
  4. 代码编码指定
  5. 其他节点的分享

了解这些,可以通过第2种方式来解决问题,在对应的bitcoin.conf文件中添加如下内容,指定一些已被验证的节点,具体如下:

1
2
3
4
5
addnode=217.16.185.175
addnode=85.214.213.86
addnode=90.252.217.49
addnode=107.170.17.56
addnode=45.33.107.92

重启节点即可。

(end)

欢迎关注

欢迎关注微信公众帐号:沉风网事(savewind)

沉风网事