mirror of
https://github.com/btcsuite/btcd.git
synced 2025-01-18 21:32:30 +01:00
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
@ -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…
Reference in New Issue
Block a user