Disable RPC server if no user/pass is provided.

This commit disables the RPC server by default if no RPC username of
password is specified (either via the command line or through the config
file).

Closes #2.
This commit is contained in:
Dave Collins 2013-08-07 11:02:31 -05:00
parent ca8496e66d
commit a9662d3169

View File

@ -261,6 +261,11 @@ func loadConfig() (*config, []string, error) {
// XXX turn off server listening.
}
// The RPC server is disabled if no username or password is provided.
if cfg.RpcUser == "" || cfg.RpcPass == "" {
cfg.DisableRpc = true
}
// Add default port to all added peer addresses if needed and remove
// duplicate addresses.
cfg.AddPeers = normalizeAndRemoveDuplicateAddresses(cfg.AddPeers)