Skip to content

Commit

Permalink
fix: fix db update error (#3063)
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Jul 6, 2021
2 parents 62a0323 + 862be04 commit b95d558
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
1 change: 0 additions & 1 deletion base_layer/wallet/src/output_manager_service/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ where TBackend: OutputManagerBackend + 'static
&mut self,
output: TransactionOutput,
) -> Result<(), OutputManagerError> {
debug!(target: LOG_TARGET, "Update metadata signature for output {}", output);
self.resources.db.update_output_metadata_signature(output).await?;
Ok(())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,26 @@ where TBackend: TransactionBackend + 'static
.find(|output| output.hash() == rtp_output.hash())
{
if rtp_output.verify_metadata_signature().is_err() {
self.resources
match self
.resources
.output_manager_service
.update_output_metadata_signature(v.clone())
.await
.map_err(|e| TransactionServiceProtocolError::new(self.id, TransactionServiceError::from(e)))?;
.map_err(|e| TransactionServiceProtocolError::new(self.id, TransactionServiceError::from(e)))
{
Ok(..) => {
debug!(target: LOG_TARGET, "Updated metadata signature for output {}", v);
},
Err(e) => {
warn!(
target: LOG_TARGET,
"Could not updated metadata signature for output {} ({}, {})",
v,
e.id,
e.error.to_string()
);
},
}
}
}

Expand Down

0 comments on commit b95d558

Please sign in to comment.