mirror of
https://github.com/status-im/status-go.git
synced 2025-01-16 09:47:13 +00:00
40359f9c1b
* Adding wakunode module * Adding wakuv2 fleet files * Add waku fleets to update-fleet-config script * Adding config items for waku v2 * Conditionally start waku v2 node depending on config * Adapting common code to use go-waku * Setting log level to info * update dependencies * update fleet config to use WakuNodes instead of BootNodes * send and receive messages * use hash returned when publishing a message * add waku store protocol * trigger signal after receiving store messages * exclude linting rule SA1019 to check deprecated packages
36 lines
923 B
Go
36 lines
923 B
Go
package swarm
|
|
|
|
import (
|
|
ma "github.com/multiformats/go-multiaddr"
|
|
mamask "github.com/whyrusleeping/multiaddr-filter"
|
|
)
|
|
|
|
// http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
|
|
var lowTimeoutFilters = ma.NewFilters()
|
|
|
|
func init() {
|
|
for _, p := range []string{
|
|
"/ip4/10.0.0.0/ipcidr/8",
|
|
"/ip4/100.64.0.0/ipcidr/10",
|
|
"/ip4/169.254.0.0/ipcidr/16",
|
|
"/ip4/172.16.0.0/ipcidr/12",
|
|
"/ip4/192.0.0.0/ipcidr/24",
|
|
"/ip4/192.0.0.0/ipcidr/29",
|
|
"/ip4/192.0.0.8/ipcidr/32",
|
|
"/ip4/192.0.0.170/ipcidr/32",
|
|
"/ip4/192.0.0.171/ipcidr/32",
|
|
"/ip4/192.0.2.0/ipcidr/24",
|
|
"/ip4/192.168.0.0/ipcidr/16",
|
|
"/ip4/198.18.0.0/ipcidr/15",
|
|
"/ip4/198.51.100.0/ipcidr/24",
|
|
"/ip4/203.0.113.0/ipcidr/24",
|
|
"/ip4/240.0.0.0/ipcidr/4",
|
|
} {
|
|
f, err := mamask.NewMask(p)
|
|
if err != nil {
|
|
panic("error in lowTimeoutFilters init: " + err.Error())
|
|
}
|
|
lowTimeoutFilters.AddDialFilter(f)
|
|
}
|
|
}
|