Merge pull request #767 from nuttycom/fix/fsblockdb_for_path_doc
Add a note about metadata database initialization to `FsBlockDb::for_path`
This commit is contained in:
commit
7599fbd3c3
|
@ -37,6 +37,9 @@ pub fn init_cache_database(db_cache: &BlockDb) -> Result<(), rusqlite::Error> {
|
|||
|
||||
/// Sets up the internal structure of the metadata cache database.
|
||||
///
|
||||
/// This will automatically apply any available migrations that have not yet been applied to the
|
||||
/// database as part of its operation.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
|
|
|
@ -627,7 +627,7 @@ impl<'a, P: consensus::Parameters> WalletWrite for DataConnStmtCache<'a, P> {
|
|||
let nullifiers = self.wallet_db.get_all_nullifiers()?;
|
||||
// If the transaction contains shielded spends from our wallet, we will store z->t
|
||||
// transactions we observe in the same way they would be stored by
|
||||
// create_spend_to_address.
|
||||
// create_spend_to_address.
|
||||
if let Some((account_id, _)) = nullifiers.iter().find(
|
||||
|(_, nf)|
|
||||
d_tx.tx.sapling_bundle().iter().flat_map(|b| b.shielded_spends().iter())
|
||||
|
@ -883,6 +883,11 @@ impl FsBlockDb {
|
|||
/// `<fsblockdb_root>/blockmeta.sqlite` and will ensure that a directory exists at
|
||||
/// `<fsblockdb_root>/blocks` where this block store will expect to find serialized block
|
||||
/// files as described for [`FsBlockDb`].
|
||||
///
|
||||
/// An application using this constructor should ensure that they call
|
||||
/// [`zcash_client_sqlite::chain::init::init_blockmetadb`] at application startup to ensure
|
||||
/// that the resulting metadata database is properly initialized and has had all required
|
||||
/// migrations applied before use.
|
||||
pub fn for_path<P: AsRef<Path>>(fsblockdb_root: P) -> Result<Self, FsBlockDbError> {
|
||||
let meta = fs::metadata(&fsblockdb_root).map_err(FsBlockDbError::Fs)?;
|
||||
if meta.is_dir() {
|
||||
|
|
Loading…
Reference in New Issue