mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-02 15:32:34 +02:00
refactor: Compile unreachable code
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 Can be reviewed with --ignore-all-space
This commit is contained in:
parent
4ad83ef09b
commit
fa3373d3ad
@ -1498,20 +1498,26 @@ std::unique_ptr<WalletDatabase> MakeDatabase(const fs::path& path, const Databas
|
|||||||
|
|
||||||
if (format == DatabaseFormat::SQLITE) {
|
if (format == DatabaseFormat::SQLITE) {
|
||||||
#ifdef USE_SQLITE
|
#ifdef USE_SQLITE
|
||||||
return MakeSQLiteDatabase(path, options, status, error);
|
if constexpr (true) {
|
||||||
#else
|
return MakeSQLiteDatabase(path, options, status, error);
|
||||||
error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support SQLite database format.", fs::PathToString(path)));
|
} else
|
||||||
status = DatabaseStatus::FAILED_BAD_FORMAT;
|
|
||||||
return nullptr;
|
|
||||||
#endif
|
#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
|
#ifdef USE_BDB
|
||||||
return MakeBerkeleyDatabase(path, options, status, error);
|
if constexpr (true) {
|
||||||
#else
|
return MakeBerkeleyDatabase(path, options, status, error);
|
||||||
error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support Berkeley DB database format.", fs::PathToString(path)));
|
} else
|
||||||
status = DatabaseStatus::FAILED_BAD_FORMAT;
|
|
||||||
return nullptr;
|
|
||||||
#endif
|
#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
|
} // namespace wallet
|
||||||
|
Loading…
Reference in New Issue
Block a user