You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
793 B

package p2p
import (
cfg "github.com/tendermint/go-config"
)
var config cfg.Config = nil
func init() {
initConfigureable(dialTimeoutKey, 3)
initConfigureable(handshakeTimeoutKey, 20)
initConfigureable(maxNumPeersKey, 50)
initConfigureable(sendRateKey, 512000) // 500KB/s
initConfigureable(recvRateKey, 512000) // 500KB/s
initConfigureable(maxPayloadSizeKey, 1024)
initConfigureable(authEncKey, true)
cfg.OnConfig(func(newConfig cfg.Config) {
config = newConfig
// fill in any config values that might be missing
for key, value := range defaultConfigValues {
config.SetDefault(key, value)
}
})
}
// default config map
var defaultConfigValues = make(map[string]interface{})
func initConfigureable(key string, value interface{}) {
defaultConfigValues[key] = value
}