mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-14 10:51:52 +02:00
lnd: pass through neutrino MaxPeers config
This enables users to set the config. We check that the currently set value of MaxPeers is non-zero.
This commit is contained in:
parent
c292acfe74
commit
a93ec3b01a
@ -248,6 +248,9 @@ const (
|
|||||||
bitcoindBackendName = "bitcoind"
|
bitcoindBackendName = "bitcoind"
|
||||||
btcdBackendName = "btcd"
|
btcdBackendName = "btcd"
|
||||||
neutrinoBackendName = "neutrino"
|
neutrinoBackendName = "neutrino"
|
||||||
|
|
||||||
|
defaultPrunedNodeMaxPeers = 4
|
||||||
|
defaultNeutrinoMaxPeers = 8
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -285,8 +288,6 @@ var (
|
|||||||
// estimatesmartfee RPC call.
|
// estimatesmartfee RPC call.
|
||||||
defaultBitcoindEstimateMode = "CONSERVATIVE"
|
defaultBitcoindEstimateMode = "CONSERVATIVE"
|
||||||
bitcoindEstimateModes = [2]string{"ECONOMICAL", defaultBitcoindEstimateMode}
|
bitcoindEstimateModes = [2]string{"ECONOMICAL", defaultBitcoindEstimateMode}
|
||||||
|
|
||||||
defaultPrunedNodeMaxPeers = 4
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Config defines the configuration options for lnd.
|
// Config defines the configuration options for lnd.
|
||||||
@ -599,6 +600,7 @@ func DefaultConfig() Config {
|
|||||||
NeutrinoMode: &lncfg.Neutrino{
|
NeutrinoMode: &lncfg.Neutrino{
|
||||||
UserAgentName: neutrino.UserAgentName,
|
UserAgentName: neutrino.UserAgentName,
|
||||||
UserAgentVersion: neutrino.UserAgentVersion,
|
UserAgentVersion: neutrino.UserAgentVersion,
|
||||||
|
MaxPeers: defaultNeutrinoMaxPeers,
|
||||||
},
|
},
|
||||||
BlockCacheSize: defaultBlockCacheSize,
|
BlockCacheSize: defaultBlockCacheSize,
|
||||||
MaxPendingChannels: lncfg.DefaultMaxPendingChannels,
|
MaxPendingChannels: lncfg.DefaultMaxPendingChannels,
|
||||||
|
@ -1528,7 +1528,11 @@ func initNeutrinoBackend(ctx context.Context, cfg *Config, chainDir string,
|
|||||||
PersistToDisk: cfg.NeutrinoMode.PersistFilters,
|
PersistToDisk: cfg.NeutrinoMode.PersistFilters,
|
||||||
}
|
}
|
||||||
|
|
||||||
neutrino.MaxPeers = 8
|
if cfg.NeutrinoMode.MaxPeers <= 0 {
|
||||||
|
return nil, nil, fmt.Errorf("a non-zero number must be set " +
|
||||||
|
"for neutrino max peers")
|
||||||
|
}
|
||||||
|
neutrino.MaxPeers = cfg.NeutrinoMode.MaxPeers
|
||||||
neutrino.BanDuration = time.Hour * 48
|
neutrino.BanDuration = time.Hour * 48
|
||||||
neutrino.UserAgentName = cfg.NeutrinoMode.UserAgentName
|
neutrino.UserAgentName = cfg.NeutrinoMode.UserAgentName
|
||||||
neutrino.UserAgentVersion = cfg.NeutrinoMode.UserAgentVersion
|
neutrino.UserAgentVersion = cfg.NeutrinoMode.UserAgentVersion
|
||||||
|
@ -88,6 +88,9 @@
|
|||||||
* [The aux bandwidth calculation was fixed for non-asset
|
* [The aux bandwidth calculation was fixed for non-asset
|
||||||
channels](https://github.com/lightningnetwork/lnd/pull/9502).
|
channels](https://github.com/lightningnetwork/lnd/pull/9502).
|
||||||
|
|
||||||
|
* [Pass through](https://github.com/lightningnetwork/lnd/pull/9601) the unused
|
||||||
|
`MaxPeers` configuration variable for neutrino mode.
|
||||||
|
|
||||||
# New Features
|
# New Features
|
||||||
|
|
||||||
* [Support](https://github.com/lightningnetwork/lnd/pull/8390) for
|
* [Support](https://github.com/lightningnetwork/lnd/pull/8390) for
|
||||||
@ -419,6 +422,7 @@ The underlying functionality between those two options remain the same.
|
|||||||
* Abdullahi Yunus
|
* Abdullahi Yunus
|
||||||
* Andras Banki-Horvath
|
* Andras Banki-Horvath
|
||||||
* Animesh Bilthare
|
* Animesh Bilthare
|
||||||
|
* bitromortac
|
||||||
* Boris Nagaev
|
* Boris Nagaev
|
||||||
* Carla Kirk-Cohen
|
* Carla Kirk-Cohen
|
||||||
* CharlieZKSmith
|
* CharlieZKSmith
|
||||||
|
@ -840,9 +840,7 @@
|
|||||||
; neutrino.connect=
|
; neutrino.connect=
|
||||||
|
|
||||||
; Max number of inbound and outbound peers.
|
; Max number of inbound and outbound peers.
|
||||||
;
|
; neutrino.maxpeers=8
|
||||||
; NOTE: This value is currently unused.
|
|
||||||
; neutrino.maxpeers=
|
|
||||||
|
|
||||||
; Add a peer to connect with at startup.
|
; Add a peer to connect with at startup.
|
||||||
; neutrino.addpeer=
|
; neutrino.addpeer=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user