Skip to content

Commit

Permalink
chore: remove commented code block
Browse files Browse the repository at this point in the history
  • Loading branch information
jcnelson committed Apr 13, 2022
1 parent c155e03 commit 9ae7bb1
Showing 1 changed file with 0 additions and 71 deletions.
71 changes: 0 additions & 71 deletions src/chainstate/stacks/index/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1655,77 +1655,6 @@ impl<'a, T: MarfTrieId> TrieStorageTransaction<'a, T> {
res
}

/*
/// Store a serialized trie, given the flush options and its block hash.
/// Depending on how the trie storage is configured, the trie will either get dumped into a
/// blob in the underlying sqlite database, or it will be appended to a flat file that lives
/// alongside the sqlite database.
fn inner_store_trie_blob(
&mut self,
flush_options: FlushOptions<'_, T>,
bhh: &T,
buffer: &[u8],
) -> Result<u32, Error> {
let unconfirmed = self.unconfirmed();
match flush_options {
FlushOptions::CurrentHeader => {
if unconfirmed {
// unconfirmed tries are always stored to sqlite
test_debug!("Store unconfirmed trie blob {} to db", &bhh);
trie_sql::write_trie_blob(&self.db, bhh, buffer)
} else {
match self.blobs.as_mut() {
Some(blobs) => blobs.store_trie_blob(&self.db, bhh, buffer, None),
None => {
test_debug!("Stored trie blob {} to db", &bhh);
trie_sql::write_trie_blob(&self.db, bhh, buffer)
}
}
/*
self.with_trie_blobs(|db, blobs| match blobs {
Some(blobs) => blobs.store_trie_blob(db, bhh, buffer, None),
None => {
test_debug!("Stored trie blob {} to db", &bhh);
trie_sql::write_trie_blob(db, bhh, buffer)
}
})
*/
}
}
FlushOptions::NewHeader(real_bhh) => {
if unconfirmed {
// unconfirmed tries are always stored to sqlite
test_debug!("Store unconfirmed trie blob {} to db", &real_bhh);
trie_sql::write_trie_blob(&self.db, real_bhh, buffer)
} else {
match self.blobs.as_mut() {
Some(blobs) => blobs.store_trie_blob(&self.db, real_bhh, buffer, None),
None => {
test_debug!("Stored trie blob {} to db", &real_bhh);
trie_sql::write_trie_blob(&self.db, real_bhh, buffer)
}
}
/*
self.with_trie_blobs(|db, blobs| match blobs {
Some(blobs) => blobs.store_trie_blob(db, real_bhh, buffer, None),
None => {
test_debug!("Stored trie blob {} to db", &real_bhh);
trie_sql::write_trie_blob(db, real_bhh, buffer)
}
})
*/
}
}
FlushOptions::MinedTable(real_bhh) => {
trie_sql::write_trie_blob_to_mined(&self.db, real_bhh, buffer)
}
FlushOptions::UnconfirmedTable => {
trie_sql::write_trie_blob_to_unconfirmed(&self.db, bhh, buffer)
}
}
}
*/

/// Inner method for flushing the UncommittedState's TrieRAM to disk.
fn inner_flush(&mut self, flush_options: FlushOptions<'_, T>) -> Result<(), Error> {
// save the currently-buffered Trie to disk, and atomically put it into place (possibly to
Expand Down

0 comments on commit 9ae7bb1

Please sign in to comment.