channeldb: treat Flags field in ChannelEdgePolicy as a bitfield

This commit is contained in:
Olaoluwa Osuntokun 2017-11-30 22:41:46 -08:00
parent 12a0488bc6
commit 9b53d7bd95
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -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