diff --git a/database/src/service/free.rs b/database/src/service/free.rs index 294e322d..53d0d095 100644 --- a/database/src/service/free.rs +++ b/database/src/service/free.rs @@ -1,7 +1,7 @@ //! General free functions used (related to `cuprate_database::service`). //---------------------------------------------------------------------------------------------------- Import -use std::sync::{Arc, RwLock}; +use std::sync::Arc; use crate::{ config::Config, @@ -34,7 +34,7 @@ pub fn init(config: Config) -> Result<(DatabaseReadHandle, DatabaseWriteHandle), let reader_threads = config.reader_threads; // Initialize the database itself. - let db = Arc::new(ConcreteEnv::open(config)?); + let db: Arc = Arc::new(ConcreteEnv::open(config)?); // Spawn the Reader thread pool and Writer. let readers = DatabaseReadHandle::init(&db, reader_threads); diff --git a/database/src/service/write.rs b/database/src/service/write.rs index 4d8f895a..3cd7e80c 100644 --- a/database/src/service/write.rs +++ b/database/src/service/write.rs @@ -2,7 +2,7 @@ //---------------------------------------------------------------------------------------------------- Import use std::{ - sync::{Arc, RwLock}, + sync::Arc, task::{Context, Poll}, }; @@ -247,7 +247,7 @@ fn write_block(env: &ConcreteEnv, block: &VerifiedBlockInformation) -> ResponseR // the transaction on `add_block()` failures. tx_rw .abort() - .expect("TODO: if we cannot maintain atomicity by aborting, should we panic?"); + .expect("could not maintain database atomicity by aborting write transaction"); Err(e) } }