Skip to content

Commit

Permalink
config: rename Vochain.OffChainDataDownloader
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mvdan authored and p4u committed Dec 19, 2023
1 parent 88ef470 commit 0a3b33d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cmd/node/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,16 +465,16 @@ 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
if err = srv.Vochain(); err != nil {
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)
}
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a3b33d

Please sign in to comment.