Merge pull request #4353 from LN-Zap/feat/neutrino-user-agent

Ability to configure neutrino useragent
This commit is contained in:
Conner Fromknecht 2020-09-23 16:45:19 -07:00 committed by GitHub
commit e135047304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 0 deletions

View File

@ -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 {

View File

@ -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,

View File

@ -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

View File

@ -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"`
}