autopilot/agent: trace log skipped nodes during scoring
This commit is contained in:
parent
d5ab95546e
commit
2f1aad257c
@ -559,6 +559,7 @@ func (a *Agent) openChans(availableFunds btcutil.Amount, numChans uint32,
|
|||||||
// order to avoid attempting to make a channel with
|
// order to avoid attempting to make a channel with
|
||||||
// ourselves.
|
// ourselves.
|
||||||
if bytes.Equal(nID[:], selfPubBytes) {
|
if bytes.Equal(nID[:], selfPubBytes) {
|
||||||
|
log.Tracef("Skipping self node %x", nID[:])
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,6 +567,8 @@ func (a *Agent) openChans(availableFunds btcutil.Amount, numChans uint32,
|
|||||||
// so we'll skip it.
|
// so we'll skip it.
|
||||||
addrs := node.Addrs()
|
addrs := node.Addrs()
|
||||||
if len(addrs) == 0 {
|
if len(addrs) == 0 {
|
||||||
|
log.Tracef("Skipping node %x since no addresses known",
|
||||||
|
nID[:])
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
addresses[nID] = addrs
|
addresses[nID] = addrs
|
||||||
@ -573,6 +576,7 @@ func (a *Agent) openChans(availableFunds btcutil.Amount, numChans uint32,
|
|||||||
// Additionally, if this node is in the blacklist, then
|
// Additionally, if this node is in the blacklist, then
|
||||||
// we'll skip it.
|
// we'll skip it.
|
||||||
if _, ok := nodesToSkip[nID]; ok {
|
if _, ok := nodesToSkip[nID]; ok {
|
||||||
|
log.Tracef("Skipping blacklisted node %x", nID[:])
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -604,12 +608,17 @@ func (a *Agent) openChans(availableFunds btcutil.Amount, numChans uint32,
|
|||||||
|
|
||||||
chanCandidates := make(map[NodeID]*AttachmentDirective)
|
chanCandidates := make(map[NodeID]*AttachmentDirective)
|
||||||
for nID := range scores {
|
for nID := range scores {
|
||||||
|
log.Tracef("Creating attachment directive for chosen node %x",
|
||||||
|
nID[:])
|
||||||
|
|
||||||
// Add addresses to the candidates.
|
// Add addresses to the candidates.
|
||||||
addrs := addresses[nID]
|
addrs := addresses[nID]
|
||||||
|
|
||||||
// If the node has no known addresses, we cannot connect to it,
|
// If the node has no known addresses, we cannot connect to it,
|
||||||
// so we'll skip it.
|
// so we'll skip it.
|
||||||
if len(addrs) == 0 {
|
if len(addrs) == 0 {
|
||||||
|
log.Tracef("Skipping scored node %x with no addresses",
|
||||||
|
nID[:])
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -621,6 +630,9 @@ func (a *Agent) openChans(availableFunds btcutil.Amount, numChans uint32,
|
|||||||
|
|
||||||
// If we run out of funds, we can break early.
|
// If we run out of funds, we can break early.
|
||||||
if chanSize < a.cfg.Constraints.MinChanSize() {
|
if chanSize < a.cfg.Constraints.MinChanSize() {
|
||||||
|
log.Tracef("Chan size %v too small to satisfy min "+
|
||||||
|
"channel size %v, breaking", chanSize,
|
||||||
|
a.cfg.Constraints.MinChanSize())
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user