atpl: remove unneeded extra filter on address availability

This commit removes an extra filter on address availability which is not
needed as the scored nodes are a already prefiltered subset of the whole
graph where address availability has already been checked.
This commit is contained in:
Andras Banki-Horvath 2020-06-17 15:49:07 +02:00
parent 0fab14502d
commit 906b0b707b
No known key found for this signature in database
GPG Key ID: 80E5375C094198D8

@ -657,17 +657,6 @@ func (a *Agent) openChans(availableFunds btcutil.Amount, numChans uint32,
log.Tracef("Creating attachment directive for chosen node %x", log.Tracef("Creating attachment directive for chosen node %x",
nID[:]) nID[:])
// Add addresses to the candidates.
addrs := addresses[nID]
// If the node has no known addresses, we cannot connect to it,
// so we'll skip it.
if len(addrs) == 0 {
log.Tracef("Skipping scored node %x with no addresses",
nID[:])
continue
}
// Track the available funds we have left. // Track the available funds we have left.
if availableFunds < chanSize { if availableFunds < chanSize {
chanSize = availableFunds chanSize = availableFunds
@ -685,7 +674,7 @@ func (a *Agent) openChans(availableFunds btcutil.Amount, numChans uint32,
chanCandidates[nID] = &AttachmentDirective{ chanCandidates[nID] = &AttachmentDirective{
NodeID: nID, NodeID: nID,
ChanAmt: chanSize, ChanAmt: chanSize,
Addrs: addrs, Addrs: addresses[nID],
} }
} }