blockchain_db: add a few const

release-v0.4.0.1
moneromooo-monero 9 years ago
parent 09324764c0
commit 8069b3ba7f
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

@ -502,7 +502,7 @@ void BlockchainBDB::remove_spent_key(const crypto::key_image& k_image)
throw1(DB_ERROR("Error adding removal of key image to db transaction")); throw1(DB_ERROR("Error adding removal of key image to db transaction"));
} }
blobdata BlockchainBDB::output_to_blob(const tx_out& output) blobdata BlockchainBDB::output_to_blob(const tx_out& output) const
{ {
LOG_PRINT_L3("BlockchainBDB::" << __func__); LOG_PRINT_L3("BlockchainBDB::" << __func__);
blobdata b; blobdata b;

@ -232,7 +232,7 @@ private:
* *
* @return the resultant blob * @return the resultant blob
*/ */
blobdata output_to_blob(const tx_out& output); blobdata output_to_blob(const tx_out& output) const;
/** /**
* @brief convert a tx output blob to a tx output * @brief convert a tx output blob to a tx output

@ -129,7 +129,7 @@ void BlockchainDB::pop_block(block& blk, std::vector<transaction>& txs)
} }
} }
bool BlockchainDB::is_open() bool BlockchainDB::is_open() const
{ {
return m_open; return m_open;
} }

@ -330,7 +330,7 @@ public:
virtual void open(const std::string& filename, const int db_flags = 0) = 0; virtual void open(const std::string& filename, const int db_flags = 0) = 0;
// returns true of the db is open/ready, else false // returns true of the db is open/ready, else false
bool is_open(); bool is_open() const;
// close and sync the db // close and sync the db
virtual void close() = 0; virtual void close() = 0;

@ -212,7 +212,7 @@ void mdb_txn_safe::abort()
} }
} }
uint64_t mdb_txn_safe::num_active_tx() uint64_t mdb_txn_safe::num_active_tx() const
{ {
return num_active_txns; return num_active_txns;
} }
@ -273,7 +273,7 @@ void BlockchainLMDB::do_resize()
mdb_txn_safe::allow_new_txns(); mdb_txn_safe::allow_new_txns();
} }
bool BlockchainLMDB::need_resize() bool BlockchainLMDB::need_resize() const
{ {
MDB_envinfo mei; MDB_envinfo mei;
@ -668,7 +668,7 @@ void BlockchainLMDB::remove_spent_key(const crypto::key_image& k_image)
throw1(DB_ERROR("Error adding removal of key image to db transaction")); throw1(DB_ERROR("Error adding removal of key image to db transaction"));
} }
blobdata BlockchainLMDB::output_to_blob(const tx_out& output) blobdata BlockchainLMDB::output_to_blob(const tx_out& output) const
{ {
LOG_PRINT_L3("BlockchainLMDB::" << __func__); LOG_PRINT_L3("BlockchainLMDB::" << __func__);
blobdata b; blobdata b;

@ -59,7 +59,7 @@ struct mdb_txn_safe
return &m_txn; return &m_txn;
} }
uint64_t num_active_tx(); uint64_t num_active_tx() const;
static void prevent_new_txns(); static void prevent_new_txns();
static void wait_no_active_txns(); static void wait_no_active_txns();
@ -201,7 +201,7 @@ public:
private: private:
void do_resize(); void do_resize();
bool need_resize(); bool need_resize() const;
virtual void add_block( const block& blk virtual void add_block( const block& blk
, const size_t& block_size , const size_t& block_size
@ -236,7 +236,7 @@ private:
* *
* @return the resultant blob * @return the resultant blob
*/ */
blobdata output_to_blob(const tx_out& output); blobdata output_to_blob(const tx_out& output) const;
/** /**
* @brief convert a tx output blob to a tx output * @brief convert a tx output blob to a tx output

Loading…
Cancel
Save