mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 15:11:09 +02:00
graph/db: detach getChannelMap from KVStore
This commit is contained in:
@@ -246,7 +246,7 @@ func (c channelMapKey) String() string {
|
|||||||
|
|
||||||
// getChannelMap loads all channel edge policies from the database and stores
|
// getChannelMap loads all channel edge policies from the database and stores
|
||||||
// them in a map.
|
// them in a map.
|
||||||
func (c *KVStore) getChannelMap(edges kvdb.RBucket) (
|
func getChannelMap(edges kvdb.RBucket) (
|
||||||
map[channelMapKey]*models.ChannelEdgePolicy, error) {
|
map[channelMapKey]*models.ChannelEdgePolicy, error) {
|
||||||
|
|
||||||
// Create a map to store all channel edge policies.
|
// Create a map to store all channel edge policies.
|
||||||
@@ -415,7 +415,7 @@ func (c *KVStore) ForEachChannel(cb func(*models.ChannelEdgeInfo,
|
|||||||
|
|
||||||
// First, load all edges in memory indexed by node and channel
|
// First, load all edges in memory indexed by node and channel
|
||||||
// id.
|
// id.
|
||||||
channelMap, err := c.getChannelMap(edges)
|
channelMap, err := getChannelMap(edges)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -479,7 +479,7 @@ func (c *KVStore) ForEachChannelCacheable(cb func(*models.CachedEdgeInfo,
|
|||||||
|
|
||||||
// First, load all edges in memory indexed by node and channel
|
// First, load all edges in memory indexed by node and channel
|
||||||
// id.
|
// id.
|
||||||
channelMap, err := c.getChannelMap(edges)
|
channelMap, err := getChannelMap(edges)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user