From 906b0b707b1c3ee2daaac302f765bab86baa32a8 Mon Sep 17 00:00:00 2001 From: Andras Banki-Horvath Date: Wed, 17 Jun 2020 15:49:07 +0200 Subject: [PATCH] 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. --- autopilot/agent.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/autopilot/agent.go b/autopilot/agent.go index 837716eb..a7e34fa9 100644 --- a/autopilot/agent.go +++ b/autopilot/agent.go @@ -657,17 +657,6 @@ func (a *Agent) openChans(availableFunds btcutil.Amount, numChans uint32, log.Tracef("Creating attachment directive for chosen node %x", 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. if availableFunds < chanSize { chanSize = availableFunds @@ -685,7 +674,7 @@ func (a *Agent) openChans(availableFunds btcutil.Amount, numChans uint32, chanCandidates[nID] = &AttachmentDirective{ NodeID: nID, ChanAmt: chanSize, - Addrs: addrs, + Addrs: addresses[nID], } }