aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_converter/blockchain_export.cpp
diff options
context:
space:
mode:
authorwarptangent <warptangent@inbox.com>2015-03-22 10:57:18 -0700
committerwarptangent <warptangent@inbox.com>2015-03-22 15:45:36 -0700
commit4bedd68d2c058184333101e4d3a31856f6226cd4 (patch)
tree015b313092cec3288f5cf8483eafcbe04128732f /src/blockchain_converter/blockchain_export.cpp
parentAdd README for blockchain converter, importer, and exporter utilities (diff)
downloadmonero-4bedd68d2c058184333101e4d3a31856f6226cd4.tar.xz
Update Blockchain::get_db() to return reference instead of pointer
Where this method is used, a BlockchainDB object is always expected, so a pointer is unnecessary and less safe.
Diffstat (limited to '')
-rw-r--r--src/blockchain_converter/blockchain_export.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/blockchain_converter/blockchain_export.cpp b/src/blockchain_converter/blockchain_export.cpp
index 2467951de..f0fd44a4f 100644
--- a/src/blockchain_converter/blockchain_export.cpp
+++ b/src/blockchain_converter/blockchain_export.cpp
@@ -148,7 +148,7 @@ void BlockchainExport::write_block(block& block)
#if SOURCE_DB == DB_MEMORY
const transaction* cb_tx_full = m_blockchain_storage->get_tx(coinbase_tx_hash);
#else
- transaction cb_tx_full = m_blockchain_storage->get_db()->get_tx(coinbase_tx_hash);
+ transaction cb_tx_full = m_blockchain_storage->get_db().get_tx(coinbase_tx_hash);
#endif
#if SOURCE_DB == DB_MEMORY
@@ -167,7 +167,7 @@ void BlockchainExport::write_block(block& block)
#if SOURCE_DB == DB_MEMORY
const transaction* tx = m_blockchain_storage->get_tx(tx_id);
#else
- transaction tx = m_blockchain_storage->get_db()->get_tx(tx_id);
+ transaction tx = m_blockchain_storage->get_db().get_tx(tx_id);
#endif
#if SOURCE_DB == DB_MEMORY
@@ -205,18 +205,18 @@ void BlockchainExport::write_block(block& block)
#if SOURCE_DB == DB_MEMORY
size_t block_size = m_blockchain_storage->get_block_size(block_height);
#else
- size_t block_size = m_blockchain_storage->get_db()->get_block_size(block_height);
+ size_t block_size = m_blockchain_storage->get_db().get_block_size(block_height);
#endif
#if SOURCE_DB == DB_MEMORY
difficulty_type cumulative_difficulty = m_blockchain_storage->get_block_cumulative_difficulty(block_height);
#else
- difficulty_type cumulative_difficulty = m_blockchain_storage->get_db()->get_block_cumulative_difficulty(block_height);
+ difficulty_type cumulative_difficulty = m_blockchain_storage->get_db().get_block_cumulative_difficulty(block_height);
#endif
#if SOURCE_DB == DB_MEMORY
uint64_t coins_generated = m_blockchain_storage->get_block_coins_generated(block_height);
#else
// TODO TEST to verify that this is the equivalent. make sure no off-by-one error with block height vs block number
- uint64_t coins_generated = m_blockchain_storage->get_db()->get_block_already_generated_coins(block_height);
+ uint64_t coins_generated = m_blockchain_storage->get_db().get_block_already_generated_coins(block_height);
#endif
*m_raw_archive << block_size;