From 0029ed39ad15a18f0245f2bb72f41537120033ab Mon Sep 17 00:00:00 2001 From: Michael Sutton Date: Mon, 6 Jan 2025 14:14:29 +0000 Subject: [PATCH] last rename --- consensus/core/src/api/mod.rs | 4 ++-- consensus/src/consensus/mod.rs | 4 ++-- consensus/src/pipeline/virtual_processor/utxo_inquirer.rs | 8 ++++---- rpc/service/src/service.rs | 1 - 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/consensus/core/src/api/mod.rs b/consensus/core/src/api/mod.rs index ef3bb098c4..400bfce177 100644 --- a/consensus/core/src/api/mod.rs +++ b/consensus/core/src/api/mod.rs @@ -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 { + /// 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 { unimplemented!() } diff --git a/consensus/src/consensus/mod.rs b/consensus/src/consensus/mod.rs index 83c84db714..b7f3bcbb51 100644 --- a/consensus/src/consensus/mod.rs +++ b/consensus/src/consensus/mod.rs @@ -689,10 +689,10 @@ impl ConsensusApi for Consensus { sample_headers } - fn get_utxo_return_address(&self, txid: Hash, target_daa_score: u64) -> Result { + fn get_utxo_return_address(&self, txid: Hash, accepting_block_daa_score: u64) -> Result { // 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 { diff --git a/consensus/src/pipeline/virtual_processor/utxo_inquirer.rs b/consensus/src/pipeline/virtual_processor/utxo_inquirer.rs index 9e96500885..5722fbf6bf 100644 --- a/consensus/src/pipeline/virtual_processor/utxo_inquirer.rs +++ b/consensus/src/pipeline/virtual_processor/utxo_inquirer.rs @@ -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 { @@ -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)?; diff --git a/rpc/service/src/service.rs b/rpc/service/src/service.rs index 6f8c5baa10..583b3caa2d 100644 --- a/rpc/service/src/service.rs +++ b/rpc/service/src/service.rs @@ -801,7 +801,6 @@ NOTE: This error usually indicates an RPC conversion error between the node and ) -> RpcResult { 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)),