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 15, 2022
1 parent cf23432 commit 2472434
Show file tree
Hide file tree
Showing 2 changed files with 320 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 @@ -67,6 +67,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 @@ -154,6 +155,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 @@ -168,6 +173,8 @@ pub async fn configure_and_initialize_node(
app_config: Arc<ApplicationConfig>,
node_identity: Arc<NodeIdentity>,
interrupt_signal: ShutdownSignal,
cleanup_orphans_at_startup: bool,
report_grpc_error: bool,
) -> Result<BaseNodeContext, ExitError> {
let result = match &app_config.base_node.db_type {
DatabaseType::Lmdb => {
Expand Down Expand Up @@ -198,6 +205,7 @@ async fn build_node_context(
app_config: Arc<ApplicationConfig>,
base_node_identity: Arc<NodeIdentity>,
interrupt_signal: ShutdownSignal,
report_grpc_error: bool,
) -> Result<BaseNodeContext, ExitError> {
//---------------------------------- Blockchain --------------------------------------------//
debug!(
Expand Down Expand Up @@ -274,5 +282,6 @@ async fn build_node_context(
base_node_comms,
base_node_dht,
base_node_handles,
report_grpc_error,
})
}
Loading

0 comments on commit 2472434

Please sign in to comment.