Skip to content

Commit

Permalink
Fix comment on peek_address
Browse files Browse the repository at this point in the history
Co-authored-by: Raj <[email protected]>
  • Loading branch information
LLFourn and rajarshimaitra committed Jan 25, 2022
1 parent 0dbe794 commit 466f46d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ impl<B, D> Wallet<B, D>
where
D: BatchDatabase,
{
// Return a newly derived address using the external descriptor
// Return a newly derived address for the specified `keychain`.
fn get_new_address(&self, keychain: KeychainKind) -> Result<AddressInfo, Error> {
let incremented_index = self.fetch_and_increment_index(keychain)?;

Expand All @@ -254,8 +254,8 @@ where
.map_err(|_| Error::ScriptDoesntHaveAddressForm)
}

// Return the the last previously derived address if it has not been used in a received
// transaction. Otherwise return a new address using [`Wallet::get_new_address`].
// Return the the last previously derived address for `keychain` if it has not been used in a
// received transaction. Otherwise return a new address using [`Wallet::get_new_address`].
fn get_unused_address(&self, keychain: KeychainKind) -> Result<AddressInfo, Error> {
let current_index = self.fetch_index(keychain)?;

Expand Down Expand Up @@ -285,7 +285,7 @@ where
}
}

// Return derived address for the external descriptor at a specific index
// Return derived address for the descriptor of given [`KeychainKind`] at a specific index
fn peek_address(&self, index: u32, keychain: KeychainKind) -> Result<AddressInfo, Error> {
self.get_descriptor_for_keychain(keychain)
.as_derived(index, &self.secp)
Expand All @@ -294,7 +294,7 @@ where
.map_err(|_| Error::ScriptDoesntHaveAddressForm)
}

// Return derived address for the external descriptor at a specific index and reset current
// Return derived address for `keychain` at a specific index and reset current
// address index
fn reset_address(&self, index: u32, keychain: KeychainKind) -> Result<AddressInfo, Error> {
self.set_index(keychain, index)?;
Expand Down

0 comments on commit 466f46d

Please sign in to comment.