Purge old witnesses
This commit is contained in:
parent
4e553b42a6
commit
ca7feb3680
|
@ -694,6 +694,14 @@ impl DbAdapter {
|
|||
params![min_height],
|
||||
)?;
|
||||
transaction.execute("DELETE FROM blocks WHERE height < ?1", params![min_height])?;
|
||||
transaction.execute(
|
||||
"DELETE FROM sapling_tree WHERE height < ?1",
|
||||
params![min_height],
|
||||
)?;
|
||||
transaction.execute(
|
||||
"DELETE FROM orchard_tree WHERE height < ?1",
|
||||
params![min_height],
|
||||
)?;
|
||||
transaction.commit()?;
|
||||
}
|
||||
log::debug!("-purge_old_witnesses");
|
||||
|
|
|
@ -207,8 +207,9 @@ async fn sync_async_inner<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
let db = db_builder.build()?;
|
||||
let mut db = db_builder.build()?;
|
||||
db.store_block_timestamp(last_height, &last_hash, last_timestamp)?;
|
||||
db.purge_old_witnesses(last_height - 500)?;
|
||||
height = last_height;
|
||||
let cb = progress_callback.lock().await;
|
||||
cb(progress.clone());
|
||||
|
@ -219,6 +220,7 @@ async fn sync_async_inner<'a>(
|
|||
if get_tx {
|
||||
get_transaction_details(coin).await?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue