p2p: improve dialTask docs

Also increase log level for "Can't resolve node"
This commit is contained in:
Felix Lange 2020-01-28 14:04:26 +01:00
parent 6353685608
commit 8cefa07079

View file

@ -425,14 +425,15 @@ func (d *dialScheduler) startDial(task *dialTask) {
}() }()
} }
// A dialTask is generated for each node that is dialed. All fields except // A dialTask generated for each node that is dialed.
// staticPoolIndex cannot be accessed while the task is running.
type dialTask struct { type dialTask struct {
staticPoolIndex int
flags connFlag flags connFlag
// These fields are private to the task and should not be
// accessed by dialScheduler while the task is running.
dest *enode.Node dest *enode.Node
lastResolved mclock.AbsTime lastResolved mclock.AbsTime
resolveDelay time.Duration resolveDelay time.Duration
staticPoolIndex int
} }
func newDialTask(dest *enode.Node, flags connFlag) *dialTask { func newDialTask(dest *enode.Node, flags connFlag) *dialTask {
@ -470,7 +471,7 @@ func (t *dialTask) run(d *dialScheduler) {
// The backoff delay resets when the node is found. // The backoff delay resets when the node is found.
func (t *dialTask) resolve(d *dialScheduler) bool { func (t *dialTask) resolve(d *dialScheduler) bool {
if d.resolver == nil { if d.resolver == nil {
d.log.Debug("Can't resolve node", "id", t.dest.ID(), "err", "discovery is disabled") d.log.Trace("Can't resolve node", "id", t.dest.ID(), "err", "discovery is disabled")
return false return false
} }
if t.resolveDelay == 0 { if t.resolveDelay == 0 {