Skip to content

Commit

Permalink
chore: obscure grpc error response
Browse files Browse the repository at this point in the history
  • Loading branch information
Cifko committed Apr 6, 2022
1 parent 1655aa9 commit a69038b
Show file tree
Hide file tree
Showing 4 changed files with 328 additions and 91 deletions.
9 changes: 9 additions & 0 deletions applications/tari_base_node/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ pub struct BaseNodeContext {
base_node_comms: CommsNode,
base_node_dht: Dht,
base_node_handles: ServiceHandles,
report_grpc_error: bool,
}

impl BaseNodeContext {
Expand Down Expand Up @@ -163,6 +164,10 @@ impl BaseNodeContext {
.expect_handle::<StateMachineHandle>()
.get_status_info_watch()
}

pub fn get_report_grpc_error(&self) -> bool {
self.report_grpc_error
}
}

/// Sets up and initializes the base node, creating the context and database
Expand All @@ -178,6 +183,7 @@ pub async fn configure_and_initialize_node(
node_identity: Arc<NodeIdentity>,
interrupt_signal: ShutdownSignal,
cleanup_orphans_at_startup: bool,
report_grpc_error: bool,
) -> Result<BaseNodeContext, ExitError> {
let result = match &config.db_type {
DatabaseType::Memory => {
Expand All @@ -202,6 +208,7 @@ pub async fn configure_and_initialize_node(
config,
interrupt_signal,
cleanup_orphans_at_startup,
report_grpc_error,
)
.await?
},
Expand All @@ -226,6 +233,7 @@ async fn build_node_context(
config: Arc<GlobalConfig>,
interrupt_signal: ShutdownSignal,
cleanup_orphans_at_startup: bool,
report_grpc_error: bool,
) -> Result<BaseNodeContext, ExitError> {
//---------------------------------- Blockchain --------------------------------------------//
debug!(
Expand Down Expand Up @@ -304,5 +312,6 @@ async fn build_node_context(
base_node_comms,
base_node_dht,
base_node_handles,
report_grpc_error,
})
}
Loading

0 comments on commit a69038b

Please sign in to comment.