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 5a81b43 commit 9339dff
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions base_layer/core/src/chain_storage/lmdb_db/lmdb_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,16 +617,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 @@ -659,7 +659,7 @@ impl LMDBDatabase {
height: u64,
header_timestamp: u64,
header_hash: &HashOutput,
input: &TransactionInput,
input: TransactionInput,
) -> Result<(), ChainStorageError> {
let input_with_output_data = self.input_with_output_data(txn, input)?;
lmdb_delete(
Expand Down Expand Up @@ -1235,7 +1235,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 Expand Up @@ -1266,7 +1266,7 @@ impl LMDBDatabase {
current_header_at_height.height,
current_header_at_height.timestamp.as_u64(),
&block_hash,
&input_with_output_data,
input_with_output_data,
)?;
}

Expand Down

0 comments on commit 9339dff

Please sign in to comment.