mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 14:40:30 +01:00
Move noiseDial from config.go to server.go
noiseDial is only called from server.go, has nothing to do with configuration, and moving it removes config.go's reliance on btcec and brontide.
This commit is contained in:
parent
bb310a3d0d
commit
896128efd0
2 changed files with 9 additions and 11 deletions
11
config.go
11
config.go
|
@ -19,10 +19,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcec"
|
|
||||||
"github.com/btcsuite/btcutil"
|
"github.com/btcsuite/btcutil"
|
||||||
flags "github.com/jessevdk/go-flags"
|
flags "github.com/jessevdk/go-flags"
|
||||||
"github.com/lightningnetwork/lnd/brontide"
|
|
||||||
"github.com/lightningnetwork/lnd/htlcswitch/hodl"
|
"github.com/lightningnetwork/lnd/htlcswitch/hodl"
|
||||||
"github.com/lightningnetwork/lnd/lncfg"
|
"github.com/lightningnetwork/lnd/lncfg"
|
||||||
"github.com/lightningnetwork/lnd/lnwire"
|
"github.com/lightningnetwork/lnd/lnwire"
|
||||||
|
@ -1029,15 +1027,6 @@ func supportedSubsystems() []string {
|
||||||
return subsystems
|
return subsystems
|
||||||
}
|
}
|
||||||
|
|
||||||
// noiseDial is a factory function which creates a connmgr compliant dialing
|
|
||||||
// function by returning a closure which includes the server's identity key.
|
|
||||||
func noiseDial(idPriv *btcec.PrivateKey) func(net.Addr) (net.Conn, error) {
|
|
||||||
return func(a net.Addr) (net.Conn, error) {
|
|
||||||
lnAddr := a.(*lnwire.NetAddress)
|
|
||||||
return brontide.Dial(idPriv, lnAddr, cfg.net.Dial)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func parseRPCParams(cConfig *chainConfig, nodeConfig interface{}, net chainCode,
|
func parseRPCParams(cConfig *chainConfig, nodeConfig interface{}, net chainCode,
|
||||||
funcName string) error {
|
funcName string) error {
|
||||||
|
|
||||||
|
|
|
@ -206,6 +206,15 @@ func parseAddr(address string) (net.Addr, error) {
|
||||||
return cfg.net.ResolveTCPAddr("tcp", hostPort)
|
return cfg.net.ResolveTCPAddr("tcp", hostPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// noiseDial is a factory function which creates a connmgr compliant dialing
|
||||||
|
// function by returning a closure which includes the server's identity key.
|
||||||
|
func noiseDial(idPriv *btcec.PrivateKey) func(net.Addr) (net.Conn, error) {
|
||||||
|
return func(a net.Addr) (net.Conn, error) {
|
||||||
|
lnAddr := a.(*lnwire.NetAddress)
|
||||||
|
return brontide.Dial(idPriv, lnAddr, cfg.net.Dial)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// newServer creates a new instance of the server which is to listen using the
|
// newServer creates a new instance of the server which is to listen using the
|
||||||
// passed listener address.
|
// passed listener address.
|
||||||
func newServer(listenAddrs []net.Addr, chanDB *channeldb.DB, cc *chainControl,
|
func newServer(listenAddrs []net.Addr, chanDB *channeldb.DB, cc *chainControl,
|
||||||
|
|
Loading…
Add table
Reference in a new issue