diff --git a/routing/notifications.go b/routing/notifications.go index 6ea68d5d..dee5300c 100644 --- a/routing/notifications.go +++ b/routing/notifications.go @@ -266,6 +266,9 @@ type ChannelEdgeUpdate struct { // MinHTLC is the minimum HTLC amount that this channel will forward. MinHTLC lnwire.MilliSatoshi + // MaxHTLC is the maximum HTLC amount that this channel will forward. + MaxHTLC lnwire.MilliSatoshi + // BaseFee is the base fee that will charged for all HTLC's forwarded // across the this channel direction. BaseFee lnwire.MilliSatoshi @@ -359,6 +362,7 @@ func addToTopologyChange(graph *channeldb.ChannelGraph, update *TopologyChange, TimeLockDelta: m.TimeLockDelta, Capacity: edgeInfo.Capacity, MinHTLC: m.MinHTLC, + MaxHTLC: m.MaxHTLC, BaseFee: m.FeeBaseMSat, FeeRate: m.FeeProportionalMillionths, AdvertisingNode: aNode, diff --git a/routing/notifications_test.go b/routing/notifications_test.go index c87813e0..9869cb67 100644 --- a/routing/notifications_test.go +++ b/routing/notifications_test.go @@ -77,6 +77,7 @@ func randEdgePolicy(chanID *lnwire.ShortChannelID, LastUpdate: time.Unix(int64(prand.Int31()), 0), TimeLockDelta: uint16(prand.Int63()), MinHTLC: lnwire.MilliSatoshi(prand.Int31()), + MaxHTLC: lnwire.MilliSatoshi(prand.Int31()), FeeBaseMSat: lnwire.MilliSatoshi(prand.Int31()), FeeProportionalMillionths: lnwire.MilliSatoshi(prand.Int31()), Node: node, @@ -435,6 +436,11 @@ func TestEdgeUpdateNotification(t *testing.T) { "expected %v, got %v", edgeAnn.MinHTLC, edgeUpdate.MinHTLC) } + if edgeUpdate.MaxHTLC != edgeAnn.MaxHTLC { + t.Fatalf("max HTLC of edge doesn't match: "+ + "expected %v, got %v", edgeAnn.MaxHTLC, + edgeUpdate.MaxHTLC) + } if edgeUpdate.BaseFee != edgeAnn.FeeBaseMSat { t.Fatalf("base fee of edge doesn't match: "+ "expected %v, got %v", edgeAnn.FeeBaseMSat, diff --git a/rpcserver.go b/rpcserver.go index e2328805..1528f6a8 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -4408,6 +4408,7 @@ func marshallTopologyChange(topChange *routing.TopologyChange) *lnrpc.GraphTopol RoutingPolicy: &lnrpc.RoutingPolicy{ TimeLockDelta: uint32(channelUpdate.TimeLockDelta), MinHtlc: int64(channelUpdate.MinHTLC), + MaxHtlc: uint64(channelUpdate.MaxHTLC), FeeBaseMsat: int64(channelUpdate.BaseFee), FeeRateMilliMsat: int64(channelUpdate.FeeRate), Disabled: channelUpdate.Disabled,