diff --git a/src/chainstate/stacks/index/storage.rs b/src/chainstate/stacks/index/storage.rs index 2b25597e58..19dceecd20 100644 --- a/src/chainstate/stacks/index/storage.rs +++ b/src/chainstate/stacks/index/storage.rs @@ -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 { - 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