routing: remove querybandwidth self node check

This function is only ever called for channels connected to self.
This commit is contained in:
Joost Jager 2019-05-21 10:04:57 +02:00
parent 68f2a04f42
commit b6102ad191
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7

@ -619,15 +619,6 @@ func newServer(listenAddrs []net.Addr, chanDB *channeldb.DB, cc *chainControl,
} }
queryBandwidth := func(edge *channeldb.ChannelEdgeInfo) lnwire.MilliSatoshi { queryBandwidth := func(edge *channeldb.ChannelEdgeInfo) lnwire.MilliSatoshi {
// If we aren't on either side of this edge, then we'll
// just thread through the capacity of the edge as we
// know it.
if !bytes.Equal(edge.NodeKey1Bytes[:], selfNode.PubKeyBytes[:]) &&
!bytes.Equal(edge.NodeKey2Bytes[:], selfNode.PubKeyBytes[:]) {
return lnwire.NewMSatFromSatoshis(edge.Capacity)
}
cid := lnwire.NewChanIDFromOutPoint(&edge.ChannelPoint) cid := lnwire.NewChanIDFromOutPoint(&edge.ChannelPoint)
link, err := s.htlcSwitch.GetLink(cid) link, err := s.htlcSwitch.GetLink(cid)
if err != nil { if err != nil {