diff options
-rw-r--r-- | CMakeLists.txt | 9 | ||||
-rw-r--r-- | src/blockchain_db/berkeleydb/db_bdb.cpp | 8 | ||||
-rw-r--r-- | src/cryptonote_core/hardfork.cpp | 2 | ||||
-rw-r--r-- | src/daemon/command_line_args.h | 2 | ||||
-rw-r--r-- | utils/gpg_keys/moneromooo.asc | 30 |
5 files changed, 30 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f9e21604f..aef7a52e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,8 +216,17 @@ if (DATABASE STREQUAL "lmdb") endif() endif() endif() + + if (BERKELEY_DB AND (ARCH_WIDTH STREQUAL "32" OR ARM6 OR ARM7)) + message(STATUS "Using Berkeley DB as default DB type") + add_definitions("-DDEFAULT_DB_TYPE=\"berkeley\"") + else() + message(STATUS "Using LMDB as default DB type") + add_definitions("-DDEFAULT_DB_TYPE=\"lmdb\"") + endif() elseif (DATABASE STREQUAL "memory") set(BLOCKCHAIN_DB DB_MEMORY) + add_definitions("-DDEFAULT_DB_TYPE=\"memory\"") else() die("Invalid database type: ${DATABASE}") endif() diff --git a/src/blockchain_db/berkeleydb/db_bdb.cpp b/src/blockchain_db/berkeleydb/db_bdb.cpp index 2a9e9a7f8..bd579ed38 100644 --- a/src/blockchain_db/berkeleydb/db_bdb.cpp +++ b/src/blockchain_db/berkeleydb/db_bdb.cpp @@ -1865,7 +1865,7 @@ void BlockchainBDB::set_hard_fork_starting_height(uint8_t version, uint64_t heig LOG_PRINT_L3("BlockchainBDB::" << __func__); check_open(); - Dbt_copy<uint8_t> val_key(version); + Dbt_copy<uint32_t> val_key(version + 1); Dbt_copy<uint64_t> val(height); if (m_hf_starting_heights->put(DB_DEFAULT_TX, &val_key, &val, 0)) throw1(DB_ERROR("Error adding hard fork starting height to db transaction.")); @@ -1876,7 +1876,7 @@ uint64_t BlockchainBDB::get_hard_fork_starting_height(uint8_t version) const LOG_PRINT_L3("BlockchainBDB::" << __func__); check_open(); - Dbt_copy<uint8_t> key(version); + Dbt_copy<uint32_t> key(version + 1); Dbt_copy<uint64_t> result; auto get_result = m_hf_starting_heights->get(DB_DEFAULT_TX, &key, &result, 0); @@ -1893,7 +1893,7 @@ void BlockchainBDB::set_hard_fork_version(uint64_t height, uint8_t version) LOG_PRINT_L3("BlockchainBDB::" << __func__); check_open(); - Dbt_copy<uint64_t> val_key(height); + Dbt_copy<uint32_t> val_key(height + 1); Dbt_copy<uint8_t> val(version); if (m_hf_versions->put(DB_DEFAULT_TX, &val_key, &val, 0)) throw1(DB_ERROR("Error adding hard fork version to db transaction.")); @@ -1904,7 +1904,7 @@ uint8_t BlockchainBDB::get_hard_fork_version(uint64_t height) const LOG_PRINT_L3("BlockchainBDB::" << __func__); check_open(); - Dbt_copy<uint64_t> key(height); + Dbt_copy<uint32_t> key(height + 1); Dbt_copy<uint8_t> result; auto get_result = m_hf_versions->get(DB_DEFAULT_TX, &key, &result, 0); diff --git a/src/cryptonote_core/hardfork.cpp b/src/cryptonote_core/hardfork.cpp index 4b40a4cf3..3a8584b7f 100644 --- a/src/cryptonote_core/hardfork.cpp +++ b/src/cryptonote_core/hardfork.cpp @@ -103,8 +103,8 @@ bool HardFork::add(uint8_t block_version, uint64_t height) while (versions.size() >= window_size) { const uint8_t old_version = versions.front(); + assert(last_versions[old_version] >= 1); last_versions[old_version]--; - assert(last_versions[old_version] >= 0); versions.pop_front(); } diff --git a/src/daemon/command_line_args.h b/src/daemon/command_line_args.h index ba98a6ea1..8da470c86 100644 --- a/src/daemon/command_line_args.h +++ b/src/daemon/command_line_args.h @@ -73,7 +73,7 @@ namespace daemon_args const command_line::arg_descriptor<std::string> arg_db_type = { "db-type" , "Specify database type" - , "lmdb" + , DEFAULT_DB_TYPE }; const command_line::arg_descriptor<uint64_t> arg_prep_blocks_threads = { "prep-blocks-threads" diff --git a/utils/gpg_keys/moneromooo.asc b/utils/gpg_keys/moneromooo.asc index 80cb7ae0b..e30809608 100644 --- a/utils/gpg_keys/moneromooo.asc +++ b/utils/gpg_keys/moneromooo.asc @@ -1,5 +1,5 @@ -----BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v2 +Version: GnuPG v1 mQINBFQym34BEADDKCspvziDW0f+T9i6iOewFO9m2XTWKXlQutCPgTkIlZZUrcTR K+ApsfPxk+PBWgucQDPv/nJVs0CNaSzqewxk7Swjsf8+YjvRmxSSg/NQEgsiBx/s @@ -13,19 +13,19 @@ XCGtzeiNJSRoklNSTpUo+qQ+bLjETjfogUvq8HpYU+oGi4qaHf+Hkmp4c5Mv3Gfh p7gDvxXOGxzq0sqfPTWTBdCj1OPfunHbbeH8ypwBlNpwVG40fJdya+Dqjwu25qX6 Xh5vxLzeJTBmlawa97MCliPvzzJgW9qHRVCa9lLloGVYLiUOS0N+dZ/r/QARAQAB tD5tb25lcm9tb29vLW1vbmVybyA8bW9uZXJvbW9vby1tb25lcm9AdXNlcnMubm9y -ZXBseS5naXRodWIuY29tPokCPwQTAQIAKQUCVDKfzgIbAwUJAdqcAAcLCQgHAwIB -BhUIAgkKCwQWAgMBAh4BAheAAAoJEGhvB0VNbO/DUvMQAJrOo9JZKD8gm1TvSE8r -ERwO59CaDk6IwZXhXFncUEJzgOCNNYUc0ulI2Y1R/abJLarrjcKZQ+yxGPsh6gVL -gRckMpRix694tAND85ebl/y2XTcblwp971QJJZm0RltdpXykymo+P2AFw/5KLhcT -XHrzFkrMXKcY+JhyczhLNMg/BMtiaV0gu8G6pq3i2L9B51wBEJaB0qFbowYvXZA0 -mF7Mi8+jlWH8K1szdkff9YtRtxTPWQmJaOB3mV6jWlZM2Cmq5Jk0U9aEbN1I20Iy -k9r9Vinno/Tv2J8QWtqNmBRWTWSQnkLrp9/rN6jTi0h3rkllI5mjm8Vtuxntkd6a -9wKog8ElPLH6zlkm0FztUt5yL9TI/nH9iFUEcxd0QjF4OyshHW1KNSgmHucXrEXg -fggLh1IMgBcmqfZJw2QgcWAyKQ8LKSC7Y0Tv2kPuCW3Z9OA8p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