mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-26 14:57:30 +02:00
multi: split database storage into remote and local instances
In this commit, we split the database storage into two classes: remote and local data. If etcd isn't active, then everything is actually just local though we use two pointers everywhere. If etcd is active, then everything but the graph goes into the remote database.
This commit is contained in:
@@ -456,7 +456,7 @@ func (p *Brontide) loadActiveChannels(chans []*channeldb.OpenChannel) (
|
||||
// Before we register this new link with the HTLC Switch, we'll
|
||||
// need to fetch its current link-layer forwarding policy from
|
||||
// the database.
|
||||
graph := p.cfg.ChannelDB.ChannelGraph()
|
||||
graph := p.cfg.ChannelGraph
|
||||
info, p1, p2, err := graph.FetchChannelEdgesByOutpoint(chanPoint)
|
||||
if err != nil && err != channeldb.ErrEdgeNotFound {
|
||||
return nil, err
|
||||
|
@@ -90,10 +90,13 @@ type Config struct {
|
||||
// ChannelLinkConfig.
|
||||
InterceptSwitch *htlcswitch.InterceptableSwitch
|
||||
|
||||
// ChannelDB is used to fetch opened channels, closed channels, and the
|
||||
// channel graph.
|
||||
// ChannelDB is used to fetch opened channels, and closed channels.
|
||||
ChannelDB *channeldb.DB
|
||||
|
||||
// ChannelGraph is a pointer to the channel graph which is used to
|
||||
// query information about the set of known active channels.
|
||||
ChannelGraph *channeldb.ChannelGraph
|
||||
|
||||
// ChainArb is used to subscribe to channel events, update contract signals,
|
||||
// and force close channels.
|
||||
ChainArb *contractcourt.ChainArbitrator
|
||||
|
Reference in New Issue
Block a user