From 72deb87f10044f13469f9d749ee1125b9e56ddcc Mon Sep 17 00:00:00 2001 From: Jude Nelson Date: Mon, 27 Jul 2020 01:14:42 -0400 Subject: [PATCH] add documentation on the use of get_indexed() within a index db conn transaction --- src/util/db.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/db.rs b/src/util/db.rs index 75ac8d3d6..f272fec20 100644 --- a/src/util/db.rs +++ b/src/util/db.rs @@ -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, Error> { get_indexed(self.tx(), &self.index, header_hash, key) }