Skip to content

Commit

Permalink
minor fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Nov 26, 2021
1 parent 95b2794 commit eb73466
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@ use crate::{
use futures::{future, future::Either};
use log::*;
use randomx_rs::RandomXFlag;
use std::{future::Future, sync::Arc, time::Duration};
use std::{future::Future, sync::Arc};
use tari_comms::{connectivity::ConnectivityRequester, PeerManager};
use tari_shutdown::ShutdownSignal;
use tokio::{
sync::{broadcast, watch},
time,
};
use tokio::sync::{broadcast, watch};

const LOG_TARGET: &str = "c::bn::base_node";

Expand Down Expand Up @@ -223,7 +220,7 @@ impl<B: BlockchainBackend + 'static> BaseNodeStateMachine<B> {
// Get the next `StateEvent`, returning a `UserQuit` state event if the interrupt signal is triggered
let mut mdc = vec![];
log_mdc::iter(|k, v| mdc.push((k.to_owned(), v.to_owned())));
let next_event = select_next_state_event(delayed(interrupt_signal), next_state_future).await;
let next_event = select_next_state_event(interrupt_signal, next_state_future).await;
log_mdc::extend(mdc);
// Publish the event on the event bus
let _ = self.event_publisher.send(Arc::new(next_event.clone()));
Expand Down Expand Up @@ -275,11 +272,3 @@ where
Either::Right((state, _)) => state,
}
}

async fn delayed<F, R>(fut: F) -> R
where F: Future<Output = R> {
let ret = fut.await;
error!(target: LOG_TARGET, "SLEEEPIN",);
time::sleep(Duration::from_secs(100)).await;
ret
}
2 changes: 0 additions & 2 deletions base_layer/core/src/chain_storage/lmdb_db/lmdb_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,6 @@ impl LMDBDatabase {
bitmap.remove(block_accum_data.deleted())?;
bitmap.finish()?;

info!(target: LOG_TARGET, "delete accum {}", height);
lmdb_delete(
write_txn,
&self.block_accumulated_data_db,
Expand Down Expand Up @@ -1124,7 +1123,6 @@ impl LMDBDatabase {
header_height: u64,
data: &BlockAccumulatedData,
) -> Result<(), ChainStorageError> {
info!(target: LOG_TARGET, "insert accum {}", data);
lmdb_insert(
txn,
&self.block_accumulated_data_db,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl TransactionOutput {
Ok(())
} else {
Err(TransactionError::ValidationError(
"Recipient output range proof failed to verify".to_string(),
"Output range proof failed to verify".to_string(),
))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ mod test {
Err(e) => assert_eq!(
e,
TransactionProtocolError::TransactionBuildError(TransactionError::ValidationError(
"Recipient output range proof failed to verify".into()
"Output range proof failed to verify".into()
))
),
}
Expand Down

0 comments on commit eb73466

Please sign in to comment.