lnwire+multi: define HasMaxHtlc helper on msgFlags

This commit is contained in:
Johan T. Halseth committed 2019-01-22 08:42:30 +01:00
1 parent 4fb1536f54
commit 7d34ce9d08
4 files changed
+14 -8

No files matched your search

+2 -2
View File
@@ -3372,7 +3372,7 @@ func serializeChanEdgePolicy(w io.Writer, edge *ChannelEdgePolicy,
// of the opaque data.
// TODO(halseth): clean up when moving to TLV.
var opaqueBuf bytes.Buffer
if edge.MessageFlags&lnwire.ChanUpdateOptionMaxHtlc != 0 {
if edge.MessageFlags.HasMaxHtlc() {
err := binary.Write(&opaqueBuf, byteOrder, uint64(edge.MaxHTLC))
if err != nil {
return err
@@ -3465,7 +3465,7 @@ func deserializeChanEdgePolicy(r io.Reader,
}
// See if optional fields are present.
if edge.MessageFlags&lnwire.ChanUpdateOptionMaxHtlc != 0 {
if edge.MessageFlags.HasMaxHtlc() {
// The max_htlc field should be at the beginning of the opaque
// bytes.
opq := edge.ExtraOpaqueData