Merge pull request #4505 from Crypt-iQ/activeNet_cleanup_0803
lnd: removing activeNetParams global, passed around instead via configs
This commit is contained in:
9 files changed
+105
-92
No files matched your search
@@ -370,7 +370,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
)
|
||||
replayLog := htlcswitch.NewDecayedLog(sharedSecretPath, cc.chainNotifier)
|
||||
sphinxRouter := sphinx.NewRouter(
|
||||
nodeKeyECDH, activeNetParams.Params, replayLog,
|
||||
nodeKeyECDH, cfg.ActiveNetParams.Params, replayLog,
|
||||
)
|
||||
|
||||
writeBufferPool := pool.NewWriteBuffer(
|
||||
@@ -773,7 +773,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
s.authGossiper = discovery.New(discovery.Config{
|
||||
Router: s.chanRouter,
|
||||
Notifier: s.cc.chainNotifier,
|
||||
ChainHash: *activeNetParams.GenesisHash,
|
||||
ChainHash: *s.cfg.ActiveNetParams.GenesisHash,
|
||||
Broadcast: s.BroadcastMessage,
|
||||
ChanSeries: chanSeries,
|
||||
NotifyWhenOnline: s.NotifyWhenOnline,
|
||||
@@ -805,9 +805,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
FetchChannel: s.remoteChanDB.FetchChannel,
|
||||
}
|
||||
|
||||
utxnStore, err := newNurseryStore(
|
||||
activeNetParams.GenesisHash, remoteChanDB,
|
||||
)
|
||||
utxnStore, err := newNurseryStore(s.cfg.ActiveNetParams.GenesisHash, remoteChanDB)
|
||||
if err != nil {
|
||||
srvrLog.Errorf("unable to create nursery store: %v", err)
|
||||
return nil, err
|
||||
@@ -817,7 +815,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
sweep.DefaultBatchWindowDuration)
|
||||
|
||||
sweeperStore, err := sweep.NewSweeperStore(
|
||||
remoteChanDB, activeNetParams.GenesisHash,
|
||||
remoteChanDB, s.cfg.ActiveNetParams.GenesisHash,
|
||||
)
|
||||
if err != nil {
|
||||
srvrLog.Errorf("unable to create sweeper store: %v", err)
|
||||
@@ -869,7 +867,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
contractBreaches := make(chan *ContractBreachEvent, 1)
|
||||
|
||||
s.chainArb = contractcourt.NewChainArbitrator(contractcourt.ChainArbitratorConfig{
|
||||
ChainHash: *activeNetParams.GenesisHash,
|
||||
ChainHash: *s.cfg.ActiveNetParams.GenesisHash,
|
||||
IncomingBroadcastDelta: lncfg.DefaultIncomingBroadcastDelta,
|
||||
OutgoingBroadcastDelta: lncfg.DefaultOutgoingBroadcastDelta,
|
||||
NewSweepAddr: newSweepPkScriptGen(cc.wallet),
|
||||
@@ -1224,7 +1222,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
AuthDial: wtclient.AuthDial,
|
||||
DB: towerClientDB,
|
||||
Policy: policy,
|
||||
ChainHash: *activeNetParams.GenesisHash,
|
||||
ChainHash: *s.cfg.ActiveNetParams.GenesisHash,
|
||||
MinBackoff: 10 * time.Second,
|
||||
MaxBackoff: 5 * time.Minute,
|
||||
ForceQuitDelay: wtclient.DefaultForceQuitDelay,
|
||||
@@ -1754,7 +1752,7 @@ func initNetworkBootstrappers(s *server) ([]discovery.NetworkPeerBootstrapper, e
|
||||
// If this isn't simnet mode, then one of our additional bootstrapping
|
||||
// sources will be the set of running DNS seeds.
|
||||
if !s.cfg.Bitcoin.SimNet || !s.cfg.Litecoin.SimNet {
|
||||
dnsSeeds, ok := chainDNSSeeds[*activeNetParams.GenesisHash]
|
||||
dnsSeeds, ok := chainDNSSeeds[*s.cfg.ActiveNetParams.GenesisHash]
|
||||
|
||||
// If we have a set of DNS seeds for this chain, then we'll add
|
||||
// it as an additional bootstrapping source.
|
||||
@@ -2815,7 +2813,7 @@ func (s *server) peerConnected(conn net.Conn, connReq *connmgr.ConnReq,
|
||||
peerAddr := &lnwire.NetAddress{
|
||||
IdentityKey: pubKey,
|
||||
Address: addr,
|
||||
ChainNet: activeNetParams.Net,
|
||||
ChainNet: s.cfg.ActiveNetParams.Net,
|
||||
}
|
||||
|
||||
// With the brontide connection established, we'll now craft the feature
|
||||
|
||||
Reference in new issue
Block a user