Skip to content

Commit

Permalink
refinement
Browse files Browse the repository at this point in the history
  • Loading branch information
hansieodendaal committed Jan 25, 2024
1 parent eaea2e8 commit 79d8591
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion base_layer/core/src/base_node/sync/rpc/sync_utxos_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ where B: BlockchainBackend + 'static

let mut inputs = Vec::with_capacity(inputs_in_block.len());
for input in inputs_in_block {
let mut output_from_current_tranche = if let Some(mined_info) = self
let output_from_current_tranche = if let Some(mined_info) = self
.db
.fetch_output(input.output_hash())
.await
Expand Down
10 changes: 5 additions & 5 deletions base_layer/core/src/chain_storage/lmdb_db/lmdb_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,16 +623,16 @@ impl LMDBDatabase {
fn input_with_output_data(
&self,
txn: &WriteTransaction<'_>,
input: &TransactionInput,
input: TransactionInput,
) -> Result<TransactionInput, ChainStorageError> {
let input_with_output_data = match input.spent_output {
SpentOutput::OutputData { .. } => input.clone(),
SpentOutput::OutputData { .. } => input,
SpentOutput::OutputHash(output_hash) => match self.fetch_output_in_txn(txn, output_hash.as_slice()) {
Ok(Some(utxo_mined_info)) => TransactionInput {
version: input.version,
spent_output: SpentOutput::create_from_output(utxo_mined_info.output),
input_data: input.input_data.clone(),
script_signature: input.script_signature.clone(),
input_data: input.input_data,
script_signature: input.script_signature,
},
Ok(None) => {
error!(
Expand Down Expand Up @@ -1240,7 +1240,7 @@ impl LMDBDatabase {
}

// unique_id_index expects inputs to be inserted before outputs
for input in &inputs {
for input in inputs {
let input_with_output_data = self.input_with_output_data(txn, input)?;
let smt_key = NodeKey::try_from(input_with_output_data.commitment()?.as_bytes())?;
match output_smt.delete(&smt_key)? {
Expand Down

0 comments on commit 79d8591

Please sign in to comment.