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:
parent
ca8496e66d
commit
a9662d3169
1 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue