From: rajarshimaitra Date: Thu, 23 Sep 2021 10:42:53 +0000 (+0530) Subject: Expose get_tx() method from `DB` to `Wallet` X-Git-Tag: v0.13.0~10^2~1 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/%22example_cli/enum.Commands.html/struct.ChainHash.html?a=commitdiff_plain;h=2ee125655b443f00aa16454fd6715afd2e1b0d23;p=bdk Expose get_tx() method from `DB` to `Wallet` --- diff --git a/src/wallet/mod.rs b/src/wallet/mod.rs index 109a219c..01dfdfc7 100644 --- a/src/wallet/mod.rs +++ b/src/wallet/mod.rs @@ -323,7 +323,7 @@ where /// Return the list of unspent outputs of this wallet /// - /// Note that this methods only operate on the internal database, which first needs to be + /// Note that this method only operates on the internal database, which first needs to be /// [`Wallet::sync`] manually. pub fn list_unspent(&self) -> Result, Error> { self.database.borrow().iter_utxos() @@ -335,6 +335,21 @@ where self.database.borrow().get_utxo(&outpoint) } + /// Return a single transactions made and received by the wallet + /// + /// Optionally fill the [`TransactionDetails::transaction`] field with the raw transaction if + /// `include_raw` is `true`. + /// + /// Note that this method only operates on the internal database, which first needs to be + /// [`Wallet::sync`] manually. + pub fn get_tx( + &self, + txid: &Txid, + include_raw: bool, + ) -> Result, Error> { + self.database.borrow().get_tx(txid, include_raw) + } + /// Return the list of transactions made and received by the wallet /// /// Optionally fill the [`TransactionDetails::transaction`] field with the raw transaction if