routing/ntfns+rpcserver: include max htlc in topology notifications
This commit is contained in:
1 parent
e62a8f3269
commit
0c6c1040d8
3 files changed
+11
No files matched your search
@@ -266,6 +266,9 @@ type ChannelEdgeUpdate struct {
|
|||||||
// MinHTLC is the minimum HTLC amount that this channel will forward.
|
// MinHTLC is the minimum HTLC amount that this channel will forward.
|
||||||
MinHTLC lnwire.MilliSatoshi
|
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
|
// BaseFee is the base fee that will charged for all HTLC's forwarded
|
||||||
// across the this channel direction.
|
// across the this channel direction.
|
||||||
BaseFee lnwire.MilliSatoshi
|
BaseFee lnwire.MilliSatoshi
|
||||||
@@ -359,6 +362,7 @@ func addToTopologyChange(graph *channeldb.ChannelGraph, update *TopologyChange,
|
|||||||
TimeLockDelta: m.TimeLockDelta,
|
TimeLockDelta: m.TimeLockDelta,
|
||||||
Capacity: edgeInfo.Capacity,
|
Capacity: edgeInfo.Capacity,
|
||||||
MinHTLC: m.MinHTLC,
|
MinHTLC: m.MinHTLC,
|
||||||
|
MaxHTLC: m.MaxHTLC,
|
||||||
BaseFee: m.FeeBaseMSat,
|
BaseFee: m.FeeBaseMSat,
|
||||||
FeeRate: m.FeeProportionalMillionths,
|
FeeRate: m.FeeProportionalMillionths,
|
||||||
AdvertisingNode: aNode,
|
AdvertisingNode: aNode,
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ func randEdgePolicy(chanID *lnwire.ShortChannelID,
|
|||||||
LastUpdate: time.Unix(int64(prand.Int31()), 0),
|
LastUpdate: time.Unix(int64(prand.Int31()), 0),
|
||||||
TimeLockDelta: uint16(prand.Int63()),
|
TimeLockDelta: uint16(prand.Int63()),
|
||||||
MinHTLC: lnwire.MilliSatoshi(prand.Int31()),
|
MinHTLC: lnwire.MilliSatoshi(prand.Int31()),
|
||||||
|
MaxHTLC: lnwire.MilliSatoshi(prand.Int31()),
|
||||||
FeeBaseMSat: lnwire.MilliSatoshi(prand.Int31()),
|
FeeBaseMSat: lnwire.MilliSatoshi(prand.Int31()),
|
||||||
FeeProportionalMillionths: lnwire.MilliSatoshi(prand.Int31()),
|
FeeProportionalMillionths: lnwire.MilliSatoshi(prand.Int31()),
|
||||||
Node: node,
|
Node: node,
|
||||||
@@ -435,6 +436,11 @@ func TestEdgeUpdateNotification(t *testing.T) {
|
|||||||
"expected %v, got %v", edgeAnn.MinHTLC,
|
"expected %v, got %v", edgeAnn.MinHTLC,
|
||||||
edgeUpdate.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 {
|
if edgeUpdate.BaseFee != edgeAnn.FeeBaseMSat {
|
||||||
t.Fatalf("base fee of edge doesn't match: "+
|
t.Fatalf("base fee of edge doesn't match: "+
|
||||||
"expected %v, got %v", edgeAnn.FeeBaseMSat,
|
"expected %v, got %v", edgeAnn.FeeBaseMSat,
|
||||||
|
|||||||
@@ -4408,6 +4408,7 @@ func marshallTopologyChange(topChange *routing.TopologyChange) *lnrpc.GraphTopol
|
|||||||
RoutingPolicy: &lnrpc.RoutingPolicy{
|
RoutingPolicy: &lnrpc.RoutingPolicy{
|
||||||
TimeLockDelta: uint32(channelUpdate.TimeLockDelta),
|
TimeLockDelta: uint32(channelUpdate.TimeLockDelta),
|
||||||
MinHtlc: int64(channelUpdate.MinHTLC),
|
MinHtlc: int64(channelUpdate.MinHTLC),
|
||||||
|
MaxHtlc: uint64(channelUpdate.MaxHTLC),
|
||||||
FeeBaseMsat: int64(channelUpdate.BaseFee),
|
FeeBaseMsat: int64(channelUpdate.BaseFee),
|
||||||
FeeRateMilliMsat: int64(channelUpdate.FeeRate),
|
FeeRateMilliMsat: int64(channelUpdate.FeeRate),
|
||||||
Disabled: channelUpdate.Disabled,
|
Disabled: channelUpdate.Disabled,
|
||||||
|
|||||||
Reference in new issue
Block a user