fundingmanager: check remote min htlc against our defaults

This commit is contained in:
Joost Jager 2019-11-15 10:36:10 +01:00
parent ddb98fcc41
commit 55ff1131de
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7

@ -2209,6 +2209,12 @@ func (f *fundingManager) addToRouterGraph(completeChan *channeldb.OpenChannel,
// need to determine the smallest HTLC it deems economically relevant.
fwdMinHTLC := completeChan.LocalChanCfg.MinHTLC
// We don't necessarily want to go as low as the remote party
// allows. Check it against our default forwarding policy.
if fwdMinHTLC < f.cfg.DefaultRoutingPolicy.MinHTLCOut {
fwdMinHTLC = f.cfg.DefaultRoutingPolicy.MinHTLCOut
}
// We'll obtain the max HTLC value we can forward in our direction, as
// we'll use this value within our ChannelUpdate. This value must be <=
// channel capacity and <= the maximum in-flight msats set by the peer.