@@ -2111,10 +2111,12 @@ func (f *fundingManager) addToRouterGraph(completeChan *channeldb.OpenChannel,
2111
2111
2112
2112
// We'll obtain the max HTLC value we can forward in our direction, as
2113
2113
// we'll use this value within our ChannelUpdate. This value must be <=
2114
- // channel capacity and <= the maximum in-flight msats set by the peer, so
2115
- // we default to max in-flight msats as this value will always be <=
2116
- // channel capacity.
2114
+ // channel capacity and <= the maximum in-flight msats set by the peer.
2117
2115
fwdMaxHTLC := completeChan .LocalChanCfg .MaxPendingAmount
2116
+ capacityMSat := lnwire .NewMSatFromSatoshis (completeChan .Capacity )
2117
+ if fwdMaxHTLC > capacityMSat {
2118
+ fwdMaxHTLC = capacityMSat
2119
+ }
2118
2120
2119
2121
ann , err := f .newChanAnnouncement (
2120
2122
f .cfg .IDKey , completeChan .IdentityPub ,
@@ -2285,12 +2287,15 @@ func (f *fundingManager) annAfterSixConfs(completeChan *channeldb.OpenChannel,
2285
2287
// HTLC it deems economically relevant.
2286
2288
fwdMinHTLC := completeChan .LocalChanCfg .MinHTLC
2287
2289
2288
- // We'll obtain the max HTLC value we can forward in our direction, as
2289
- // we'll use this value within our ChannelUpdate. This value must be <=
2290
- // channel capacity and <= the maximum in-flight msats set by the peer,
2291
- // so we default to max in-flight msats as this value will always be <=
2292
- // channel capacity.
2290
+ // We'll obtain the max HTLC value we can forward in our
2291
+ // direction, as we'll use this value within our ChannelUpdate.
2292
+ // This value must be <= channel capacity and <= the maximum
2293
+ // in-flight msats set by the peer.
2293
2294
fwdMaxHTLC := completeChan .LocalChanCfg .MaxPendingAmount
2295
+ capacityMSat := lnwire .NewMSatFromSatoshis (completeChan .Capacity )
2296
+ if fwdMaxHTLC > capacityMSat {
2297
+ fwdMaxHTLC = capacityMSat
2298
+ }
2294
2299
2295
2300
// Create and broadcast the proofs required to make this channel
2296
2301
// public and usable for other nodes for routing.
0 commit comments