mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
Merge bitcoin/bitcoin#29315: refactor: Compile unreachable walletdb code
fa3373d3ad
refactor: Compile unreachable code (MarcoFalke) Pull request description: When unreachable code isn't compiled, compile failures are not detected. Fix this by leaving it unreachable, but compiling it. Fixes https://github.com/bitcoin/bitcoin/pull/28999#discussion_r1465010916 ACKs for top commit: achow101: ACKfa3373d3ad
ryanofsky: Code review ACKfa3373d3ad
. This looks good, and should prevent code in the else blocks from accidentally breaking. Tree-SHA512: 3a3764915dfc935bf5d7a48f1ca151dcbac340c1cbdce8236b24ae9b4f04d6ee9771ed058ca60bcbca6e19d13671de3517f828a8f7ab6444c7cc4e3538d1ba4e
This commit is contained in:
commit
717103bcce
1 changed files with 16 additions and 10 deletions
|
@ -1498,20 +1498,26 @@ std::unique_ptr<WalletDatabase> MakeDatabase(const fs::path& path, const Databas
|
|||
|
||||
if (format == DatabaseFormat::SQLITE) {
|
||||
#ifdef USE_SQLITE
|
||||
return MakeSQLiteDatabase(path, options, status, error);
|
||||
#else
|
||||
error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support SQLite database format.", fs::PathToString(path)));
|
||||
status = DatabaseStatus::FAILED_BAD_FORMAT;
|
||||
return nullptr;
|
||||
if constexpr (true) {
|
||||
return MakeSQLiteDatabase(path, options, status, error);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support SQLite database format.", fs::PathToString(path)));
|
||||
status = DatabaseStatus::FAILED_BAD_FORMAT;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_BDB
|
||||
return MakeBerkeleyDatabase(path, options, status, error);
|
||||
#else
|
||||
error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support Berkeley DB database format.", fs::PathToString(path)));
|
||||
status = DatabaseStatus::FAILED_BAD_FORMAT;
|
||||
return nullptr;
|
||||
if constexpr (true) {
|
||||
return MakeBerkeleyDatabase(path, options, status, error);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support Berkeley DB database format.", fs::PathToString(path)));
|
||||
status = DatabaseStatus::FAILED_BAD_FORMAT;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
} // namespace wallet
|
||||
|
|
Loading…
Add table
Reference in a new issue