git ssb

3+

andrestaltz / easy-ssb-pub



Commit fd0ab790daac31d5be529cf2ae2d280f97d3727f

Avoid connecting to itself over SSB

Andre Staltz committed on 2/28/2017, 1:53:44 PM
Parent: 64a15b7be8674a700ce54b717be1ef3e5b52bad0

Files changed

src/index.tschanged
src/index.tsView
@@ -77,9 +77,9 @@
7777
7878 peer.on('connection', function (connection, _info) {
7979 const info = _info;
8080 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) {
8282 debug('Found discovery swarm peer %s:%s, %s', info.host, info.port, info._peername);
8383
8484 const remoteSbotHost = info.host;
8585 const remoteSbotKey = info.id.split('ssb:')[1];

Built with git-ssb-web