Commit fd0ab790daac31d5be529cf2ae2d280f97d3727f
Avoid connecting to itself over SSB
Andre Staltz committed on 2/28/2017, 1:53:44 PMParent: 64a15b7be8674a700ce54b717be1ef3e5b52bad0
Files changed
src/index.ts | changed |
src/index.ts | ||
---|---|---|
@@ -77,9 +77,9 @@ | ||
77 | 77 … | |
78 | 78 … | peer.on('connection', function (connection, _info) { |
79 | 79 … | const info = _info; |
80 | 80 … | info.id = info.id.toString('ascii'); |
81 | - if (info.id.indexOf('ssb:') === 0 && info.host) { | |
81 … | + if (info.id.indexOf('ssb:') === 0 && info.host && info.host !== config.host) { | |
82 | 82 … | debug('Found discovery swarm peer %s:%s, %s', info.host, info.port, info._peername); |
83 | 83 … | |
84 | 84 … | const remoteSbotHost = info.host; |
85 | 85 … | const remoteSbotKey = info.id.split('ssb:')[1]; |
Built with git-ssb-web