Skip to content

Commit

Permalink
fix: sleep less as some UTXOs are false alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
grumbach committed Jun 6, 2024
1 parent 07490d3 commit e06d7e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sn_auditor/src/dag_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ lazy_static! {
std::env::var("UTXO_REATTEMPT_INTERVAL")
.unwrap_or("3600".to_string())
.parse::<u64>()
.unwrap_or(3600)
.unwrap_or(300)
);

/// time in seconds to rest between DAG crawls
Expand Down
11 changes: 11 additions & 0 deletions sn_client/src/audit/dag_crawling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,15 @@ impl Client {
// forward spends to processing if provided
let build_handle: tokio::task::JoinHandle<Result<SpendDag, WalletError>> =
tokio::spawn(async move {
debug!("Starting building DAG from {spend_addr:?}...");
let now = std::time::Instant::now();
let mut dag = SpendDag::new(spend_addr);
while let Some(spend) = rx.recv().await {
let addr = spend.address();
debug!(
"Inserting spend at {addr:?} size: {}",
dag.all_spends().len()
);
dag.insert(addr, spend.clone());
if let Some(sender) = &spend_processing {
sender
Expand All @@ -86,6 +92,11 @@ impl Client {
.map_err(|e| WalletError::SpendProcessing(e.to_string()))?;
}
}
info!(
"Done gathering DAG of size: {} in {:?}",
dag.all_spends().len(),
now.elapsed()
);
Ok(dag)
});

Expand Down

0 comments on commit e06d7e1

Please sign in to comment.