Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bug that causes non p2p apps to panic on startup #3131

Merged
merged 2 commits into from
Jul 23, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion common/src/configuration/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,9 +762,17 @@ where

fn network_transport_config(
cfg: &Config,
application: ApplicationType,
mut application: ApplicationType,
network: &str,
) -> Result<CommsTransport, ConfigurationError> {
const P2P_APPS: &[ApplicationType] = &[ApplicationType::BaseNode, ApplicationType::ConsoleWallet];
if !P2P_APPS.contains(&application) {
// TODO: If/when we split the configs by app, this hack can be removed
// This removed the need to setup defaults for apps that dont use the network,
// assuming base node has been set up
application = ApplicationType::BaseNode;
}

let get_conf_str = |key| {
cfg.get_str(key)
.map_err(|err| ConfigurationError::new(key, &err.to_string()))
Expand Down