]> Untitled Git - bdk/commitdiff
[wallet] Expose an immutable reference to a wallet's database
authorAlekos Filini <alekos.filini@gmail.com>
Sat, 23 Oct 2021 13:00:09 +0000 (15:00 +0200)
committerAlekos Filini <alekos.filini@gmail.com>
Wed, 10 Nov 2021 11:29:58 +0000 (12:29 +0100)
src/wallet/mod.rs

index b8d1196d94d794b469b0b98981a0d57e09fea689..b811662b976557db3fd0740effca41d085f888f1 100644 (file)
@@ -1447,6 +1447,11 @@ where
 
         Ok(())
     }
+
+    /// Return an immutable reference to the internal database
+    pub fn database(&self) -> impl std::ops::Deref<Target = D> + '_ {
+        self.database.borrow()
+    }
 }
 
 impl<B, D> Wallet<B, D>