Skip to content

Commit

Permalink
Docker change for partial setting up of rpc params
Browse files Browse the repository at this point in the history
  • Loading branch information
Vutov committed Jul 19, 2018
1 parent 69229f2 commit 3150fe2
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1020,14 +1020,7 @@ func parseRPCParams(cConfig *chainConfig, nodeConfig interface{}, net chainCode,
case bitcoingoldChain:
daemonName = "bgoldd"
}
// If only one or two of the parameters are set, we assume the
// user did that unintentionally.
if conf.RPCUser != "" || conf.RPCPass != "" || conf.ZMQPath != "" {
return fmt.Errorf("please set all or none of "+
"%[1]v.rpcuser, %[1]v.rpcpass, "+
"and %[1]v.zmqpath", daemonName)
}


switch net {
case bitcoingoldChain:
confDir = conf.Dir
Expand Down Expand Up @@ -1074,7 +1067,15 @@ func parseRPCParams(cConfig *chainConfig, nodeConfig interface{}, net chainCode,
" %v, cannot start w/o RPC connection",
err)
}
nConf.RPCUser, nConf.RPCPass, nConf.ZMQPath = rpcUser, rpcPass, zmqPath
if nConf.RPCUser == "" {
nConf.RPCUser = rpcUser
}
if nConf.RPCPass == "" {
nConf.RPCPass = rpcPass
}
if nConf.ZMQPath == "" {
nConf.ZMQPath = zmqPath
}
}

fmt.Printf("Automatically obtained %v's RPC credentials\n", daemonName)
Expand Down

0 comments on commit 3150fe2

Please sign in to comment.