From abab3a72fcd5e1498e0322d813108b4578f17075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 15 Dec 2023 23:51:09 +0000 Subject: [PATCH] config: rename Vochain.OffChainDataDownloader cmd/node calls the flag vochainOffChainDataDownload, and viper unmarshals that to our config struct, meaning that after our recent viper cleanup the field was now dangling. Rather than adding another special case or renaming the flag, since the only user of the config field is cmd/node itself, rename the field to be consistent with the flag and YAML. --- cmd/node/main.go | 6 +++--- config/config.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/node/main.go b/cmd/node/main.go index 80b7f86ae..05bc44757 100644 --- a/cmd/node/main.go +++ b/cmd/node/main.go @@ -465,8 +465,8 @@ func main() { conf.Vochain.IsSeedNode = types.ModeSeed == conf.Mode // do we need indexer? conf.Vochain.Indexer.Enabled = conf.Mode == types.ModeGateway - // offchainDataDownloader is only needed for gateways - conf.Vochain.OffChainDataDownloader = conf.Vochain.OffChainDataDownloader && + // offchainDataDownload is only needed for gateways + conf.Vochain.OffChainDataDownload = conf.Vochain.OffChainDataDownload && conf.Mode == types.ModeGateway // create the vochain service @@ -474,7 +474,7 @@ func main() { log.Fatal(err) } // create the offchain data downloader service - if conf.Vochain.OffChainDataDownloader { + if conf.Vochain.OffChainDataDownload { if err := srv.OffChainDataHandler(); err != nil { log.Fatal(err) } diff --git a/config/config.go b/config/config.go index 721965ab1..f50d2d4aa 100644 --- a/config/config.go +++ b/config/config.go @@ -126,7 +126,7 @@ type VochainCfg struct { // IsSeedNode specifies if the node is configured to act as a seed node IsSeedNode bool // OffChainDataDownload specifies if the node is configured to download off-chain data - OffChainDataDownloader bool + OffChainDataDownload bool } // IndexerCfg handles the configuration options of the indexer