diff options
author | Thomas Winget <tewinget@gmail.com> | 2014-10-30 14:57:39 -0400 |
---|---|---|
committer | warptangent <warptangent@inbox.com> | 2015-01-04 19:31:19 -0800 |
commit | 71b18d716637066d758243cea191dedcc237b3e5 (patch) | |
tree | 4b8649c651c50d1f1e754bb5375d87a81e02227d | |
parent | BlockchainLMDB seems to be working*! (diff) | |
download | monero-71b18d716637066d758243cea191dedcc237b3e5.tar.xz |
moar bug fixes, removed debug prints
-rw-r--r-- | src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp | 3 | ||||
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 9 |
2 files changed, 4 insertions, 8 deletions
diff --git a/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp b/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp index 58f0d920f..033e177dc 100644 --- a/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp +++ b/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp @@ -1541,7 +1541,6 @@ tx_out_index BlockchainLMDB::get_output_tx_and_index(const uint64_t& amount, con size_t num_elems = 0; mdb_cursor_count(cur, &num_elems); - LOG_PRINT_L0(__func__ << ": amount == " << amount << ", index == " << index << ", num_elem for amount == " << num_elems); if (num_elems <= index) { LOG_PRINT_L1("Attempting to get an output index by amount and amount index, but output not found"); @@ -1594,8 +1593,6 @@ tx_out_index BlockchainLMDB::get_output_tx_and_index(const uint64_t& amount, con txn.commit(); - LOG_PRINT_L0(__func__ << ": tx_hash == " << pod_to_hex(tx_hash) << " tx_index == " << *(uint64_t*)v.mv_data); - return tx_out_index(tx_hash, *(uint64_t *)v.mv_data); } diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 39bf39df3..37ff4248e 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -623,11 +623,10 @@ difficulty_type Blockchain::get_difficulty_for_next_block() size_t offset = h - std::min(h, static_cast<size_t>(DIFFICULTY_BLOCKS_COUNT)); - // because BlockchainDB::height() returns the index of the top block, the - // first index we need to get needs to be one - // higher than height() - DIFFICULTY_BLOCKS_COUNT. This also conveniently - // makes sure we don't use the genesis block. - ++offset; + if (offset == 0) + { + ++offset; + } for(; offset < h; offset++) { |