Skip to content

Commit a919af3

Browse files
committed
f Rename inner wallet field to inner
1 parent 2036269 commit a919af3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/wallet.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ where
3535
// A BDK blockchain used for wallet sync.
3636
blockchain: EsploraBlockchain,
3737
// A BDK on-chain wallet.
38-
wallet: Mutex<bdk::Wallet<D>>,
38+
inner: Mutex<bdk::Wallet<D>>,
3939
// A cache storing the most recently retrieved fee rate estimations.
4040
fee_rate_cache: Mutex<HashMap<ConfirmationTarget, FeeRate>>,
4141
tokio_runtime: RwLock<Option<Arc<tokio::runtime::Runtime>>>,
@@ -49,15 +49,15 @@ where
4949
pub(crate) fn new(
5050
blockchain: EsploraBlockchain, wallet: bdk::Wallet<D>, logger: Arc<FilesystemLogger>,
5151
) -> Self {
52-
let wallet = Mutex::new(wallet);
52+
let inner = Mutex::new(wallet);
5353
let fee_rate_cache = Mutex::new(HashMap::new());
5454
let tokio_runtime = RwLock::new(None);
55-
Self { blockchain, wallet, fee_rate_cache, tokio_runtime, logger }
55+
Self { blockchain, inner, fee_rate_cache, tokio_runtime, logger }
5656
}
5757

5858
pub(crate) async fn sync(&self) -> Result<(), Error> {
5959
let sync_options = SyncOptions { progress: None };
60-
match self.wallet.lock().unwrap().sync(&self.blockchain, sync_options).await {
60+
match self.inner.lock().unwrap().sync(&self.blockchain, sync_options).await {
6161
Ok(()) => Ok(()),
6262
Err(e) => {
6363
log_error!(self.logger, "Wallet sync error: {}", e);
@@ -79,7 +79,7 @@ where
7979
) -> Result<Transaction, Error> {
8080
let fee_rate = self.estimate_fee_rate(confirmation_target);
8181

82-
let locked_wallet = self.wallet.lock().unwrap();
82+
let locked_wallet = self.inner.lock().unwrap();
8383
let mut tx_builder = locked_wallet.build_tx();
8484

8585
tx_builder.add_recipient(output_script.clone(), value_sats).fee_rate(fee_rate).enable_rbf();
@@ -112,12 +112,12 @@ where
112112
}
113113

114114
pub(crate) fn get_new_address(&self) -> Result<bitcoin::Address, Error> {
115-
let address_info = self.wallet.lock().unwrap().get_address(AddressIndex::New)?;
115+
let address_info = self.inner.lock().unwrap().get_address(AddressIndex::New)?;
116116
Ok(address_info.address)
117117
}
118118

119119
pub(crate) fn get_balance(&self) -> Result<bdk::Balance, Error> {
120-
Ok(self.wallet.lock().unwrap().get_balance()?)
120+
Ok(self.inner.lock().unwrap().get_balance()?)
121121
}
122122

123123
fn estimate_fee_rate(&self, confirmation_target: ConfirmationTarget) -> FeeRate {

0 commit comments

Comments
 (0)