diff options
author | Riccardo Spagni <ric@spagni.net> | 2015-08-10 20:04:30 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2015-08-10 20:04:32 +0200 |
commit | 09cada45c4e02b5f5dc6c8878dfe90035fe491d4 (patch) | |
tree | 62bab4f94f9fb6b934f79172f6cc1b684a88edb6 /src/blockchain_db/lmdb | |
parent | Merge pull request #362 (diff) | |
parent | blockchain: factor get_num_outpouts(amount) calls (diff) | |
download | monero-09cada45c4e02b5f5dc6c8878dfe90035fe491d4.tar.xz |
Merge pull request #363
4f19e68 blockchain: factor get_num_outpouts(amount) calls (moneromooo-monero)
275894c blockchain: always select random outs using triangular distribution (moneromooo-monero)
Diffstat (limited to 'src/blockchain_db/lmdb')
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.cpp | 13 | ||||
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.h | 2 |
2 files changed, 0 insertions, 15 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 5401932aa..1583a0c06 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -1637,19 +1637,6 @@ uint64_t BlockchainLMDB::get_tx_block_height(const crypto::hash& h) const return *(const uint64_t*)result.mv_data; } -//FIXME: make sure the random method used here is appropriate -uint64_t BlockchainLMDB::get_random_output(const uint64_t& amount) const -{ - LOG_PRINT_L3("BlockchainLMDB::" << __func__); - check_open(); - - uint64_t num_outputs = get_num_outputs(amount); - if (num_outputs == 0) - throw1(OUTPUT_DNE("Attempting to get a random output for an amount, but none exist")); - - return crypto::rand<uint64_t>() % num_outputs; -} - uint64_t BlockchainLMDB::get_num_outputs(const uint64_t& amount) const { LOG_PRINT_L3("BlockchainLMDB::" << __func__); diff --git a/src/blockchain_db/lmdb/db_lmdb.h b/src/blockchain_db/lmdb/db_lmdb.h index 0facb8713..b4c197803 100644 --- a/src/blockchain_db/lmdb/db_lmdb.h +++ b/src/blockchain_db/lmdb/db_lmdb.h @@ -157,8 +157,6 @@ public: virtual uint64_t get_tx_block_height(const crypto::hash& h) const; - virtual uint64_t get_random_output(const uint64_t& amount) const; - virtual uint64_t get_num_outputs(const uint64_t& amount) const; virtual output_data_t get_output_key(const uint64_t& amount, const uint64_t& index); |