diff options
author | Ilya Kitaev <mbg033@gmail.com> | 2016-03-31 12:01:19 +0300 |
---|---|---|
committer | Ilya Kitaev <mbg033@gmail.com> | 2016-03-31 12:01:19 +0300 |
commit | df6026182ab1df95a07d01ad54481e7ebf2c69e7 (patch) | |
tree | 5b9813551c37b8ad30687e5c2aaae238d2119d5e /src/blockchain_db/lmdb/db_lmdb.h | |
parent | - testnet option added to api; (diff) | |
parent | Merge pull request #770 (diff) | |
download | monero-df6026182ab1df95a07d01ad54481e7ebf2c69e7.tar.xz |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/blockchain_db/lmdb/db_lmdb.h')
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.h b/src/blockchain_db/lmdb/db_lmdb.h index 718ee1058..6cd3e0e8f 100644 --- a/src/blockchain_db/lmdb/db_lmdb.h +++ b/src/blockchain_db/lmdb/db_lmdb.h @@ -115,7 +115,7 @@ typedef struct mdb_threadinfo struct mdb_txn_safe { - mdb_txn_safe(); + mdb_txn_safe(const bool check=true); ~mdb_txn_safe(); void commit(std::string message = ""); @@ -142,8 +142,10 @@ struct mdb_txn_safe static void wait_no_active_txns(); static void allow_new_txns(); + mdb_threadinfo* m_tinfo; MDB_txn* m_txn; bool m_batch_txn = false; + bool m_check; static std::atomic<uint64_t> num_active_txns; // could use a mutex here, but this should be sufficient. @@ -278,6 +280,16 @@ public: virtual void pop_block(block& blk, std::vector<transaction>& txs); virtual bool can_thread_bulk_indices() const { return true; } + + /** + * @brief return a histogram of outputs on the blockchain + * + * @param amounts optional set of amounts to lookup + * + * @return a set of amount/instances + */ + std::map<uint64_t, uint64_t> get_output_histogram(const std::vector<uint64_t> &amounts) const; + private: void do_resize(uint64_t size_increase=0); |