Skip to content

Commit

Permalink
last rename
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsutton committed Jan 6, 2025
1 parent f61eee6 commit 0029ed3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions consensus/core/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ pub trait ConsensusApi: Send + Sync {
}

/// Returns the first paying address for `txid` (i.e., the address signed by its first input).
/// The argument `daa_score` is expected to be the DAA score of the accepting chain block of `txid`.
fn get_utxo_return_address(&self, txid: Hash, daa_score: u64) -> Result<Address, ReturnAddressError> {
/// The argument `accepting_block_daa_score` is expected to be the DAA score of the accepting chain block of `txid`.
fn get_utxo_return_address(&self, txid: Hash, accepting_block_daa_score: u64) -> Result<Address, ReturnAddressError> {
unimplemented!()
}

Expand Down
4 changes: 2 additions & 2 deletions consensus/src/consensus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,10 +689,10 @@ impl ConsensusApi for Consensus {
sample_headers
}

fn get_utxo_return_address(&self, txid: Hash, target_daa_score: u64) -> Result<Address, ReturnAddressError> {
fn get_utxo_return_address(&self, txid: Hash, accepting_block_daa_score: u64) -> Result<Address, ReturnAddressError> {
// We need consistency between the pruning_point_store, utxo_diffs_store, block_transactions_store, selected chain and headers store reads
let _guard = self.pruning_lock.blocking_read();
self.virtual_processor.get_utxo_return_address(txid, target_daa_score, self.get_source(), self.config.prefix())
self.virtual_processor.get_utxo_return_address(txid, accepting_block_daa_score, self.get_source(), self.config.prefix())
}

fn get_virtual_parents(&self) -> BlockHashSet {
Expand Down
8 changes: 4 additions & 4 deletions consensus/src/pipeline/virtual_processor/utxo_inquirer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ use super::VirtualStateProcessor;

impl VirtualStateProcessor {
/// Returns the first paying address for `txid` (i.e., the address signed by its first input).
/// The argument `target_daa_score` is expected to be the DAA score of the accepting chain block of `txid`.
/// The argument `accepting_block_daa_score` is expected to be the DAA score of the accepting chain block of `txid`.
///
/// *Assumed to be called under the pruning read lock.*
pub fn get_utxo_return_address(
&self,
txid: Hash,
target_daa_score: u64,
accepting_block_daa_score: u64,
source_hash: Hash,
prefix: Prefix,
) -> Result<Address, ReturnAddressError> {
Expand All @@ -33,13 +33,13 @@ impl VirtualStateProcessor {
.map(|compact_header| compact_header.daa_score)
.map_err(|_| ReturnAddressError::MissingCompactHeaderForBlockHash(source_hash))?;

if target_daa_score < source_daa_score {
if accepting_block_daa_score < source_daa_score {
// Early exit if target daa score is lower than that of pruning point's daa score:
return Err(ReturnAddressError::AlreadyPruned);
}

let (matching_chain_block_hash, acceptance_data) =
self.find_accepting_chain_block_hash_at_daa_score(target_daa_score, source_hash)?;
self.find_accepting_chain_block_hash_at_daa_score(accepting_block_daa_score, source_hash)?;

let tx = self.find_tx_from_acceptance_data(txid, &acceptance_data)?;

Expand Down
1 change: 0 additions & 1 deletion rpc/service/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,6 @@ NOTE: This error usually indicates an RPC conversion error between the node and
) -> RpcResult<GetUtxoReturnAddressResponse> {
let session = self.consensus_manager.consensus().session().await;

// Convert a SPK to an Address
match session.async_get_utxo_return_address(request.txid, request.accepting_block_daa_score).await {
Ok(return_address) => return Ok(GetUtxoReturnAddressResponse { return_address }),
Err(error) => return Err(RpcError::UtxoReturnAddressNotFound(error)),
Expand Down

0 comments on commit 0029ed3

Please sign in to comment.