lnd: newChainControlFromConfig can now create light client backed chainControl

This commit finishes up the implementation of newChainControlFromConfig
in order to properly initiate the members of the chainControl struct
when the new light client mode (neutrino). With this lnd is now able to
switch over to either mode with a simple configuration change.
This commit is contained in:
Olaoluwa Osuntokun
2017-05-24 17:46:37 -07:00
parent 33decbe6ab
commit 593ba7c8f0
2 changed files with 58 additions and 38 deletions

5
lnd.go
View File

@ -64,11 +64,14 @@ func lndMain() error {
// With the information parsed from the configuration, create valid
// instances of the paertinent interfaces required to operate the
// Lightning Network Daemon.
activeChainControl, err := newChainControlFromConfig(cfg, chanDB)
activeChainControl, chainCleanUp, err := newChainControlFromConfig(cfg, chanDB)
if err != nil {
fmt.Printf("unable to create chain control: %v\n", err)
return err
}
if chainCleanUp != nil {
defer chainCleanUp()
}
// Finally before we start the server, we'll register the "holy
// trinity" of interface for our current "home chain" with the active