Merge pull request #2750 from cryptagoras/patch-1

htlcswitch/switch: log target node on insufficient cap error
This commit is contained in:
Johan T. Halseth 2019-03-27 15:10:08 +01:00 committed by GitHub
commit 59e3390f6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1038,7 +1038,8 @@ func (s *Switch) handlePacketForward(packet *htlcPacket) error {
return s.failAddPacket(packet, failure, addErr) return s.failAddPacket(packet, failure, addErr)
} }
interfaceLinks, _ := s.getLinks(targetLink.Peer().PubKey()) targetPeerKey := targetLink.Peer().PubKey()
interfaceLinks, _ := s.getLinks(targetPeerKey)
s.indexMtx.RUnlock() s.indexMtx.RUnlock()
// We'll keep track of any HTLC failures during the link // We'll keep track of any HTLC failures during the link
@ -1105,7 +1106,7 @@ func (s *Switch) handlePacketForward(packet *htlcPacket) error {
addErr := fmt.Errorf("unable to find appropriate "+ addErr := fmt.Errorf("unable to find appropriate "+
"channel link insufficient capacity, need "+ "channel link insufficient capacity, need "+
"%v", htlc.Amount) "%v towards node=%x", htlc.Amount, targetPeerKey)
return s.failAddPacket(packet, failure, addErr) return s.failAddPacket(packet, failure, addErr)