mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-05-13 17:11:47 +08:00
add documentation on the use of get_indexed() within a index db conn transaction
This commit is contained in:
@@ -626,6 +626,10 @@ impl<'a, C: Clone, T: MarfTrieId> IndexDBTx<'a, C, T> {
|
||||
}
|
||||
|
||||
/// Get a value from the fork index
|
||||
/// NOTE: until the TrieFileStorage implementation of reopen_readonly() is made zero-copy --
|
||||
/// namely, made so it doesn't just naively clone the underlying TrieRAM when reopening
|
||||
/// read-only, the caller should make sure to only use the get_indexed() _before_ writing any
|
||||
/// MARF key/value pairs. Doing so afterwards will clone all uncommitted trie state.
|
||||
pub fn get_indexed(&self, header_hash: &T, key: &str) -> Result<Option<String>, Error> {
|
||||
get_indexed(self.tx(), &self.index, header_hash, key)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user