bitcoincore_rpc::jsonrpc::error::RpcError { code: -8, .. }, ))) => Ok(None), Err(bitcoincore_rpc::Error::JsonRpc(bitcoincore_rpc::jsonrpc::error::Error::Rpc( bitcoincore_rpc::jsonrpc::error::RpcError { message, .. }, ))) if message.ends_with("not found") => { Ok(None) } Err(err) => Err(err.into()), } } } pub(crate) struct Index { client: Client, database: Database, durability: redb::Durability, first_inscription_height: u32, genesis_block_coinbase_transaction: Transaction, genesis_block_coinbase_txid: Txid, height_limit: Option, index_runes: bool, index_sats: bool, options: Options, path: PathBuf, unrecoverably_reorged: AtomicBool, } impl Index { pub(crate) fn open(options: &Options) -> Result { let client = options.bitcoin_rpc_client()?; let path = if let Some(path) = &options.index { path.clone() } else { options.data_dir()?.join("index.redb") }; if let Err(err) = fs::create_dir_all(path.parent().unwrap()) {