diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-10-25 10:41:59 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-10-25 12:36:06 +0000 |
commit | 0a5a5e859791b6ff0ced2a3f403eed71fb41dee2 (patch) | |
tree | 45b146feb52998c0a6a77ac93d53d96dd630c425 /src/blockchain_db/berkeleydb/db_bdb.cpp | |
parent | db_bdb: DB_KEYEMPTY is also not found for non-top recon fields (diff) | |
download | monero-0a5a5e859791b6ff0ced2a3f403eed71fb41dee2.tar.xz |
db_bdb: record numbers for recno databases start at 1
Diffstat (limited to '')
-rw-r--r-- | src/blockchain_db/berkeleydb/db_bdb.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/blockchain_db/berkeleydb/db_bdb.cpp b/src/blockchain_db/berkeleydb/db_bdb.cpp index 11c8cc8a4..7648d657d 100644 --- a/src/blockchain_db/berkeleydb/db_bdb.cpp +++ b/src/blockchain_db/berkeleydb/db_bdb.cpp @@ -1315,7 +1315,7 @@ output_data_t BlockchainBDB::get_output_key(const uint64_t& global_index) const LOG_PRINT_L3("BlockchainBDB::" << __func__); check_open(); - Dbt_copy<uint32_t> k(global_index); + Dbt_copy<uint32_t> k(global_index + 1); Dbt_copy<output_data_t> v; auto get_result = m_output_keys->get(DB_DEFAULT_TX, &k, &v, 0); if (get_result == DB_NOTFOUND) @@ -1467,7 +1467,7 @@ tx_out_index BlockchainBDB::get_output_tx_and_index_from_global(const uint64_t& LOG_PRINT_L3("BlockchainBDB::" << __func__); check_open(); - Dbt_copy<uint32_t> k(index); + Dbt_copy<uint32_t> k(index + 1); Dbt_copy<crypto::hash > v; auto get_result = m_output_txs->get(DB_DEFAULT_TX, &k, &v, 0); @@ -1826,7 +1826,7 @@ void BlockchainBDB::get_output_key(const uint64_t &amount, const std::vector<uin { for (const uint64_t &index : global_indices) { - Dbt_copy<uint32_t> k(index); + Dbt_copy<uint32_t> k(index + 1); Dbt_copy<output_data_t> v; auto get_result = m_output_keys->get(DB_DEFAULT_TX, &k, &v, 0); |