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
@@ -1324,7 +1324,7 @@ func (d *AuthenticatedGossiper) retransmitStaleChannels() error {
// If this edge has a ChannelUpdate that was created before the
// introduction of the MaxHTLC field, then we'll update this
// edge to propagate this information in the network.
if edge.MessageFlags&lnwire.ChanUpdateOptionMaxHtlc == 0 {
if !edge.MessageFlags.HasMaxHtlc() {
edgesToUpdate = append(edgesToUpdate, updateTuple{
info: info,
edge: edge,
@@ -2520,7 +2520,7 @@ func (d *AuthenticatedGossiper) updateChannel(info *channeldb.ChannelEdgeInfo,
// We'll make sure we support the new max_htlc field if not already
// present.
if edge.MessageFlags&lnwire.ChanUpdateOptionMaxHtlc == 0 {
if !edge.MessageFlags.HasMaxHtlc() {
edge.MessageFlags |= lnwire.ChanUpdateOptionMaxHtlc
edge.MaxHTLC = lnwire.NewMSatFromSatoshis(info.Capacity)
}