mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-29 10:09:08 +02:00
multi: partition lnwire.ChanUpdateFlag into ChannelFlags and MessageFlags
In this commit: * we partition lnwire.ChanUpdateFlag into two (ChanUpdateChanFlags and ChanUpdateMsgFlags), from a uint16 to a pair of uint8's * we rename the ChannelUpdate.Flags to ChannelFlags and add an additional MessageFlags field, which will be used to indicate the presence of the optional field HtlcMaximumMsat within the ChannelUpdate. * we partition ChannelEdgePolicy.Flags into message and channel flags. This change corresponds to the partitioning of the ChannelUpdate's Flags field into MessageFlags and ChannelFlags. Co-authored-by: Johan T. Halseth <johanth@gmail.com>
This commit is contained in:
committed by
Johan T. Halseth
parent
375be936ce
commit
0fd6004958
@ -550,7 +550,8 @@ func TestSendPaymentErrorRepeatedFeeInsufficient(t *testing.T) {
|
||||
errChanUpdate := lnwire.ChannelUpdate{
|
||||
ShortChannelID: lnwire.NewShortChanIDFromInt(chanID),
|
||||
Timestamp: uint32(edgeUpateToFail.LastUpdate.Unix()),
|
||||
Flags: edgeUpateToFail.Flags,
|
||||
MessageFlags: edgeUpateToFail.MessageFlags,
|
||||
ChannelFlags: edgeUpateToFail.ChannelFlags,
|
||||
TimeLockDelta: edgeUpateToFail.TimeLockDelta,
|
||||
HtlcMinimumMsat: edgeUpateToFail.MinHTLC,
|
||||
BaseFee: uint32(edgeUpateToFail.FeeBaseMSat),
|
||||
@ -656,7 +657,8 @@ func TestSendPaymentErrorNonFinalTimeLockErrors(t *testing.T) {
|
||||
errChanUpdate := lnwire.ChannelUpdate{
|
||||
ShortChannelID: lnwire.NewShortChanIDFromInt(chanID),
|
||||
Timestamp: uint32(edgeUpateToFail.LastUpdate.Unix()),
|
||||
Flags: edgeUpateToFail.Flags,
|
||||
MessageFlags: edgeUpateToFail.MessageFlags,
|
||||
ChannelFlags: edgeUpateToFail.ChannelFlags,
|
||||
TimeLockDelta: edgeUpateToFail.TimeLockDelta,
|
||||
HtlcMinimumMsat: edgeUpateToFail.MinHTLC,
|
||||
BaseFee: uint32(edgeUpateToFail.FeeBaseMSat),
|
||||
@ -1098,7 +1100,7 @@ func TestAddEdgeUnknownVertexes(t *testing.T) {
|
||||
FeeBaseMSat: 10,
|
||||
FeeProportionalMillionths: 10000,
|
||||
}
|
||||
edgePolicy.Flags = 0
|
||||
edgePolicy.ChannelFlags = 0
|
||||
|
||||
if err := ctx.router.UpdateEdge(edgePolicy); err != nil {
|
||||
t.Fatalf("unable to update edge policy: %v", err)
|
||||
@ -1114,7 +1116,7 @@ func TestAddEdgeUnknownVertexes(t *testing.T) {
|
||||
FeeBaseMSat: 10,
|
||||
FeeProportionalMillionths: 10000,
|
||||
}
|
||||
edgePolicy.Flags = 1
|
||||
edgePolicy.ChannelFlags = 1
|
||||
|
||||
if err := ctx.router.UpdateEdge(edgePolicy); err != nil {
|
||||
t.Fatalf("unable to update edge policy: %v", err)
|
||||
@ -1194,7 +1196,7 @@ func TestAddEdgeUnknownVertexes(t *testing.T) {
|
||||
FeeBaseMSat: 10,
|
||||
FeeProportionalMillionths: 10000,
|
||||
}
|
||||
edgePolicy.Flags = 0
|
||||
edgePolicy.ChannelFlags = 0
|
||||
|
||||
if err := ctx.router.UpdateEdge(edgePolicy); err != nil {
|
||||
t.Fatalf("unable to update edge policy: %v", err)
|
||||
@ -1209,7 +1211,7 @@ func TestAddEdgeUnknownVertexes(t *testing.T) {
|
||||
FeeBaseMSat: 10,
|
||||
FeeProportionalMillionths: 10000,
|
||||
}
|
||||
edgePolicy.Flags = 1
|
||||
edgePolicy.ChannelFlags = 1
|
||||
|
||||
if err := ctx.router.UpdateEdge(edgePolicy); err != nil {
|
||||
t.Fatalf("unable to update edge policy: %v", err)
|
||||
@ -2099,7 +2101,7 @@ func TestIsStaleEdgePolicy(t *testing.T) {
|
||||
FeeBaseMSat: 10,
|
||||
FeeProportionalMillionths: 10000,
|
||||
}
|
||||
edgePolicy.Flags = 0
|
||||
edgePolicy.ChannelFlags = 0
|
||||
if err := ctx.router.UpdateEdge(edgePolicy); err != nil {
|
||||
t.Fatalf("unable to update edge policy: %v", err)
|
||||
}
|
||||
@ -2113,7 +2115,7 @@ func TestIsStaleEdgePolicy(t *testing.T) {
|
||||
FeeBaseMSat: 10,
|
||||
FeeProportionalMillionths: 10000,
|
||||
}
|
||||
edgePolicy.Flags = 1
|
||||
edgePolicy.ChannelFlags = 1
|
||||
if err := ctx.router.UpdateEdge(edgePolicy); err != nil {
|
||||
t.Fatalf("unable to update edge policy: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user