channeldb: store unknown policies in database
The commit ensures that for every channel, there will always be two entries in the edges bucket. If the policy from one or both ends of the channel is unknown, it is marked as such. This allows efficient lookup of incoming edges. This is required for backwards payment path finding.
This commit is contained in:
1 parent
d2612e51bd
commit
6c918a1806
7 files changed
+322
-43
No files matched your search
@@ -2136,6 +2136,10 @@ func (r *ChannelRouter) ForAllOutgoingChannels(cb func(*channeldb.ChannelEdgeInf
|
||||
return r.selfNode.ForEachChannel(nil, func(_ *bolt.Tx, c *channeldb.ChannelEdgeInfo,
|
||||
e, _ *channeldb.ChannelEdgePolicy) error {
|
||||
|
||||
if e == nil {
|
||||
return fmt.Errorf("Channel from self node has no policy")
|
||||
}
|
||||
|
||||
return cb(c, e)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user