diff --git a/btcd.go b/btcd.go index 482dd564..63e8be29 100644 --- a/btcd.go +++ b/btcd.go @@ -19,7 +19,8 @@ import ( "time" ) -// used by the dns seed code to pick a random last seen time +// These constants are used by the dns seed code to pick a random last seen +// time. const ( secondsIn3Days int32 = 24 * 60 * 60 * 3 secondsIn4Days int32 = 24 * 60 * 60 * 4 diff --git a/config.go b/config.go index 394a96cf..d782f097 100644 --- a/config.go +++ b/config.go @@ -45,9 +45,9 @@ type config struct { MaxPeers int `long:"maxpeers" description:"Max number of inbound and outbound peers"` BanDuration time.Duration `long:"banduration" description:"How long to ban misbehaving peers. Valid time units are {s, m, h}. Minimum 1 second"` VerifyDisabled bool `long:"noverify" description:"Disable block/transaction verification -- WARNING: This option can be dangerous and is for development use only"` - RpcUser string `short:"u" long:"rpcuser" description:"Username for rpc connections"` - RpcPass string `short:"P" long:"rpcpass" description:"Password for rpc connections"` - RpcPort string `short:"r" long:"rpcport" description:"Listen for json/rpc messages on this port"` + RpcUser string `short:"u" long:"rpcuser" description:"Username for RPC connections"` + RpcPass string `short:"P" long:"rpcpass" description:"Password for RPC connections"` + RpcPort string `short:"r" long:"rpcport" description:"Listen for JSON/RPC messages on this port"` DisableRpc bool `long:"norpc" description:"Disable built-in RPC server -- NOTE: The RPC server is disabled by default if no rpcuser/rpcpass is specified"` DisableDNSSeed bool `long:"nodnsseed" description:"Disable DNS seeding for peers"` Proxy string `long:"proxy" description:"Connect via SOCKS5 proxy (eg. 127.0.0.1:9050)"` @@ -120,6 +120,8 @@ func removeDuplicateAddresses(addrs []string) []string { return result } +// normalizeAndRemoveDuplicateAddresses return a new slice with all the passed +// addresses normalized and duplicates removed. func normalizeAndRemoveDuplicateAddresses(addrs []string) []string { for i, addr := range addrs { addrs[i] = normalizePeerAddress(addr) diff --git a/discovery.go b/discovery.go index e7f1741e..76896385 100644 --- a/discovery.go +++ b/discovery.go @@ -144,11 +144,11 @@ func torLookupIP(host, proxy string) ([]net.IP, error) { return addr, nil } -// dnsDiscover looks up the list of peers resolved by dns for all hosts in -// seeders. If proxy is not "" then this is used as a tor proxy for the -// resolution. If any errors occur then that seeder that errored will not have +// dnsDiscover looks up the list of peers resolved by DNS for all hosts in +// seeders. If proxy is not "" then it is used as a tor proxy for the +// resolution. If any errors occur then the seeder that errored will not have // any hosts in the list. Therefore if all hosts failed an empty slice of -// strings will be returned. +// strings will be returned. func dnsDiscover(seeders []string, proxy string) []net.IP { peers := []net.IP{} for _, seeder := range seeders { diff --git a/sample-btcd.conf b/sample-btcd.conf index bc0965ac..f57bd2d3 100644 --- a/sample-btcd.conf +++ b/sample-btcd.conf @@ -15,7 +15,7 @@ ; The SOCKS5 proxy above is Tor (https://www.torproject.org). ; Although not required if the proxy set is indeed Tor, setting this option ; does the following: -; - Sends DNS queries over the Tor network (during dns seed lookup). This +; - Sends DNS queries over the Tor network (during DNS seed lookup). This ; stops your IP from being leaked via DNS. ; - Does not disable the listening port. This allows the hidden services ; feature of Tor to be used. @@ -47,7 +47,7 @@ ; specified. ; ------------------------------------------------------------------------------ -; Secure the RPC api by specifying the username and password. You must specify +; Secure the RPC API by specifying the username and password. You must specify ; both or the RPC server will be disabled. ; rpcuser=whatever_username_you_want ; rpcpass=