Skip to content

Commit

Permalink
channeldb: treat Flags field in ChannelEdgePolicy as a bitfield
Browse files Browse the repository at this point in the history
  • Loading branch information
Roasbeef committed Dec 1, 2017
1 parent 12a0488 commit 9b53d7b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions channeldb/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9b53d7b

Please sign in to comment.