aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwarptangent <warptangent@inbox.com>2015-03-03 13:09:49 -0800
committerwarptangent <warptangent@inbox.com>2015-03-15 13:22:32 -0700
commitacb5d291b893bf2b3e6378ea516690d4dc04fecc (patch)
tree16f5fc44574cf5b90e37c9e4cbe945150f70c48e /src
parentBlockchainDB implementations have names now (diff)
downloadmonero-acb5d291b893bf2b3e6378ea516690d4dc04fecc.tar.xz
Update and relocate comment that applies class wide
Diffstat (limited to 'src')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index ee49e1827..495f93bdc 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -149,6 +149,20 @@ inline void lmdb_db_open(MDB_txn* txn, const char* name, int flags, MDB_dbi& dbi
namespace cryptonote
{
+// If m_batch_active is set, a batch transaction exists beyond this class, such
+// as a batch import with verification enabled, or possibly (later) a batch
+// network sync.
+//
+// For some of the lookup methods, such as get_block_timestamp(), tx_exists(),
+// and get_tx(), when m_batch_active is set, the lookup uses the batch
+// transaction. This isn't only because the transaction is available, but it's
+// necessary so that lookups include the database updates only present in the
+// current batch write.
+//
+// A regular network sync without batch writes is expected to open a new read
+// transaction, as those lookups are part of the validation done prior to the
+// write for block and tx data, so no write transaction is open at the time.
+
void BlockchainLMDB::add_block( const block& blk
, const size_t& block_size
, const difficulty_type& cumulative_difficulty
@@ -1260,14 +1274,6 @@ uint64_t BlockchainLMDB::get_tx_block_height(const crypto::hash& h) const
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
check_open();
- // If m_batch_active is set, a batch transaction exists beyond this class,
- // such as a batch import with verification enabled, or possibly (later) a
- // batch network sync.
- //
- // A regular network sync without batching would be expected to open a new
- // read transaction here, as validation is done prior to the write for block
- // and tx data.
-
txn_safe txn;
txn_safe* txn_ptr = &txn;
if (m_batch_active)