Browse Source

some comments

pull/1519/head
Ethan Buchman 7 years ago
parent
commit
0450e35d67
2 changed files with 4 additions and 7 deletions
  1. +3
    -1
      p2p/netaddress.go
  2. +1
    -6
      p2p/pex/pex_reactor.go

+ 3
- 1
p2p/netaddress.go View File

@ -22,7 +22,9 @@ type NetAddress struct {
ID ID `json:"id"` ID ID `json:"id"`
IP net.IP `json:"ip"` IP net.IP `json:"ip"`
Port uint16 `json:"port"` Port uint16 `json:"port"`
Name string `json:"name"` // optional DNS name
// TODO:
// Name string `json:"name"` // optional DNS name
// memoize .String() // memoize .String()
str string str string


+ 1
- 6
p2p/pex/pex_reactor.go View File

@ -126,9 +126,7 @@ func (r *PEXReactor) OnStart() error {
} }
// return err if user provided a bad seed address // return err if user provided a bad seed address
// NOTE: only if its an invalid address.
// If we simply fail to resovle a DNS name,
// we shouldn't exit here ...
// or a host name that we cant resolve
if err := r.checkSeeds(); err != nil { if err := r.checkSeeds(); err != nil {
return err return err
} }
@ -500,9 +498,6 @@ func (r *PEXReactor) checkSeeds() error {
if lSeeds == 0 { if lSeeds == 0 {
return nil return nil
} }
// TODO: don't exit the program if we simply cant resolve a DNS name.
// But if names or addresses are incorrectly speficied (ie. invalid),
// then we should return an err that causes an exit
_, errs := p2p.NewNetAddressStrings(r.config.Seeds) _, errs := p2p.NewNetAddressStrings(r.config.Seeds)
for _, err := range errs { for _, err := range errs {
if err != nil { if err != nil {


Loading…
Cancel
Save