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:
Valentine Wallace
2019-01-12 18:59:43 +01:00
committed by Johan T. Halseth
parent 375be936ce
commit 0fd6004958
21 changed files with 176 additions and 113 deletions

View File

@@ -608,7 +608,8 @@ func TestLightningWireProtocol(t *testing.T) {
req := ChannelUpdate{
ShortChannelID: NewShortChanIDFromInt(uint64(r.Int63())),
Timestamp: uint32(r.Int31()),
Flags: ChanUpdateFlag(r.Int31()),
MessageFlags: ChanUpdateMsgFlags(r.Int31()),
ChannelFlags: ChanUpdateChanFlags(r.Int31()),
TimeLockDelta: uint16(r.Int31()),
HtlcMinimumMsat: MilliSatoshi(r.Int63()),
BaseFee: uint32(r.Int31()),