diff --git a/chainregistry.go b/chainregistry.go index c534b4e7..19536534 100644 --- a/chainregistry.go +++ b/chainregistry.go @@ -803,6 +803,8 @@ func initNeutrinoBackend(cfg *Config, chainDir string) (*neutrino.ChainService, neutrino.MaxPeers = 8 neutrino.BanDuration = time.Hour * 48 + neutrino.UserAgentName = cfg.NeutrinoMode.UserAgentName + neutrino.UserAgentVersion = cfg.NeutrinoMode.UserAgentVersion neutrinoCS, err := neutrino.NewChainService(config) if err != nil { diff --git a/config.go b/config.go index 51d84a5a..e8107170 100644 --- a/config.go +++ b/config.go @@ -20,6 +20,7 @@ import ( "github.com/btcsuite/btcutil" flags "github.com/jessevdk/go-flags" + "github.com/lightninglabs/neutrino" "github.com/lightningnetwork/lnd/autopilot" "github.com/lightningnetwork/lnd/build" "github.com/lightningnetwork/lnd/chanbackup" @@ -372,6 +373,10 @@ func DefaultConfig() Config { RPCHost: defaultRPCHost, EstimateMode: defaultBitcoindEstimateMode, }, + NeutrinoMode: &lncfg.Neutrino{ + UserAgentName: neutrino.UserAgentName, + UserAgentVersion: neutrino.UserAgentVersion, + }, UnsafeDisconnect: true, MaxPendingChannels: lncfg.DefaultMaxPendingChannels, NoSeedBackup: defaultNoSeedBackup, diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 21c8bb9a..784834c8 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -211,6 +211,8 @@ neutrino: --neutrino.maxpeers= Max number of inbound and outbound peers --neutrino.banduration= How long to ban misbehaving peers. Valid time units are {s, m, h}. Minimum 1 second --neutrino.banthreshold= Maximum allowed ban score before disconnecting and banning misbehaving peers. + --neutrino.useragentname= Used to help identify ourselves to other bitcoin peers. + --neutrino.useragentversion= Used to help identify ourselves to other bitcoin peers. ``` ## Bitcoind Options diff --git a/lncfg/neutrino.go b/lncfg/neutrino.go index db4c3d4d..dc7bb581 100644 --- a/lncfg/neutrino.go +++ b/lncfg/neutrino.go @@ -12,4 +12,6 @@ type Neutrino struct { BanThreshold uint32 `long:"banthreshold" description:"Maximum allowed ban score before disconnecting and banning misbehaving peers."` FeeURL string `long:"feeurl" description:"DEPRECATED: Optional URL for fee estimation. If a URL is not specified, static fees will be used for estimation."` AssertFilterHeader string `long:"assertfilterheader" description:"Optional filter header in height:hash format to assert the state of neutrino's filter header chain on startup. If the assertion does not hold, then the filter header chain will be re-synced from the genesis block."` + UserAgentName string `long:"useragentname" description:"Used to help identify ourselves to other bitcoin peers"` + UserAgentVersion string `long:"useragentversion" description:"Used to help identify ourselves to other bitcoin peers"` }