git ssb

4+

Dominic / scuttlebot



Commit 682c3a5400995ac0d881d88c82a8647730578ba2

validate types before calling gossip.add

Dominic Tarr committed on 10/2/2016, 11:38:12 AM
Parent: 89b461182f81d528dca83a253120f017014cfc19

Files changed

plugins/gossip/init.jschanged
plugins/gossip/init.jsView
@@ -1,6 +1,7 @@
11 var isArray = Array.isArray
22 var pull = require('pull-stream')
3 +var ref = require('ssb-ref')
34
45 module.exports = function (gossip, config, server) {
56
67 // populate peertable with configured seeds (mainly used in testing)
@@ -15,9 +16,10 @@
1516 type: 'pub', live: true, keys: false
1617 }),
1718 pull.drain(function (msg) {
1819 if(!msg.content.address) return
19- gossip.add(msg.content.address, 'pub')
20 + if(ref.isAddress(msg.content.address))
21 + gossip.add(msg.content.address, 'pub')
2022 })
2123 )
2224
2325 // populate peertable with announcements on the LAN multicast

Built with git-ssb-web