@@ -20,12 +20,13 @@ use std::{mem, sync::Arc};
2020
2121use tokio:: sync:: mpsc;
2222use tower:: { Service , ServiceExt } ;
23- use tracing:: { info, level_filters:: LevelFilter } ;
23+ use tracing:: { error , info, level_filters:: LevelFilter } ;
2424use tracing_subscriber:: { layer:: SubscriberExt , reload:: Handle , util:: SubscriberInitExt , Registry } ;
2525
2626use cuprate_consensus_context:: {
2727 BlockChainContextRequest , BlockChainContextResponse , BlockchainContextService ,
2828} ;
29+ use cuprate_database:: { InitError , DATABASE_CORRUPT_MSG } ;
2930use cuprate_helper:: time:: secs_to_hms;
3031use cuprate_types:: blockchain:: BlockchainWriteRequest ;
3132
@@ -77,9 +78,13 @@ fn main() {
7778 config. blockchain_config ( ) ,
7879 Arc :: clone ( & db_thread_pool) ,
7980 )
80- . unwrap ( ) ;
81+ . inspect_err ( |e| error ! ( "Blockchain database error: {e}" ) )
82+ . expect ( DATABASE_CORRUPT_MSG ) ;
83+
8184 let ( txpool_read_handle, txpool_write_handle, _) =
82- cuprate_txpool:: service:: init_with_pool ( config. txpool_config ( ) , db_thread_pool) . unwrap ( ) ;
85+ cuprate_txpool:: service:: init_with_pool ( config. txpool_config ( ) , db_thread_pool)
86+ . inspect_err ( |e| error ! ( "Txpool database error: {e}" ) )
87+ . expect ( DATABASE_CORRUPT_MSG ) ;
8388
8489 // Initialize async tasks.
8590
0 commit comments