From 9b53d7bd95dc44bf1be324c39a6c9265eb263171 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 30 Nov 2017 22:41:46 -0800 Subject: [PATCH] channeldb: treat Flags field in ChannelEdgePolicy as a bitfield --- channeldb/graph.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/channeldb/graph.go b/channeldb/graph.go index 74c58908f..788e58b19 100644 --- a/channeldb/graph.go +++ b/channeldb/graph.go @@ -967,7 +967,7 @@ func (c *ChannelGraph) UpdateEdgePolicy(edge *ChannelEdgePolicy) error { // Depending on the flags value passed above, either the first // or second edge policy is being updated. var fromNode, toNode []byte - if edge.Flags == 0 { + if edge.Flags&lnwire.ChanUpdateDirection == 0 { fromNode = nodeInfo[:33] toNode = nodeInfo[33:67] } else { @@ -1336,8 +1336,7 @@ type ChannelEdgePolicy struct { // Flags is a bitfield which signals the capabilities of the channel as // well as the directed edge this update applies to. - // TODO(roasbeef): make into wire struct - Flags uint16 + Flags lnwire.ChanUpdateFlag // TimeLockDelta is the number of blocks this node will subtract from // the expiry of an incoming HTLC. This value expresses the time buffer