From 2084cb0ad5316263d6dbc897662a3743602090ee Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Wed, 28 Apr 2021 16:16:34 -0700 Subject: [PATCH] lncfg: add config options for new neutrino options --- lncfg/neutrino.go | 2 ++ lnd.go | 2 ++ sample-lnd.conf | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/lncfg/neutrino.go b/lncfg/neutrino.go index f8a84a44..999b5d73 100644 --- a/lncfg/neutrino.go +++ b/lncfg/neutrino.go @@ -15,4 +15,6 @@ type Neutrino struct { 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"` ValidateChannels bool `long:"validatechannels" description:"Validate every channel in the graph during sync by downloading the containing block. This is the inverse of routing.assumechanvalid, meaning that for Neutrino the validation is turned off by default for massively increased graph sync performance. This speedup comes at the risk of using an unvalidated view of the network for routing. Overwrites the value of routing.assumechanvalid if Neutrino is used. (default: false)"` + BroadcastTimeout time.Duration `long:"broadcasttimeout" description:"The amount of time to wait before giving up on a transaction broadcast attempt."` + PersistFilters bool `long:"persistfilters" description:"Whether compact filters fetched from the P2P network should be persisted to disk."` } diff --git a/lnd.go b/lnd.go index 2559d0aa..f8e0d6e6 100644 --- a/lnd.go +++ b/lnd.go @@ -1670,6 +1670,8 @@ func initNeutrinoBackend(cfg *Config, chainDir string, }, AssertFilterHeader: headerStateAssertion, BlockCache: blockCache.Cache, + BroadcastTimeout: cfg.NeutrinoMode.BroadcastTimeout, + PersistToDisk: cfg.NeutrinoMode.PersistFilters, } neutrino.MaxPeers = 8 diff --git a/sample-lnd.conf b/sample-lnd.conf index 06158331..a9129070 100644 --- a/sample-lnd.conf +++ b/sample-lnd.conf @@ -482,6 +482,12 @@ bitcoin.node=btcd ; Used to help identify ourselves to other bitcoin peers (default: 0.11.0-beta). ; neutrino.useragentversion=0.11.0-beta +; The amount of time to wait before giving up on a transaction broadcast attempt. +; neutrino.broadcasttimeout=5s + +; Whether compact filters fetched from the P2P network should be persisted to disk. +; neutrino.persistfilters=true + ; Validate every channel in the graph during sync by downloading the containing ; block. This is the inverse of routing.assumechanvalid, meaning that for ; Neutrino the validation is turned off by default for massively increased graph