diff options
author | Andrew Chow <achow101-github@achow101.com> | 2021-04-07 20:55:09 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2021-04-12 19:29:03 -0400 |
commit | 41f891da508114f1fd4df30b4068073ec30abc2a (patch) | |
tree | 1b3e171dfbc7eadf4d503659e4c973dcc93c3d9d /src/wallet/init.cpp | |
parent | cb79cabdd9d9a6d183cf09575dd46925f2c9cb3b (diff) |
tests: Skip SQLite fsyncs while testing
Since we want tests to run quickly, and since tests do a lot more db
operations than expected we expect to see in actual usage, we disable
sqlite's syncing behavior to make db operations run much faster. This
syncing behavior is necessary for normal operation as it helps guarantee
that data won't become lost or corrupted, but in tests, we don't care
about that.
Diffstat (limited to 'src/wallet/init.cpp')
-rw-r--r-- | src/wallet/init.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp index fdeead1fa5..0dc220b6fd 100644 --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -82,6 +82,12 @@ void WalletInit::AddWalletOptions(ArgsManager& argsman) const argsman.AddHiddenArgs({"-dblogsize", "-flushwallet", "-privdb"}); #endif +#ifdef USE_SQLITE + argsman.AddArg("-unsafesqlitesync", "Set SQLite synchronous=OFF to disable waiting for the database to sync to disk. This is unsafe and can cause data loss and corruption. This option is only used by tests to improve their performance (default: false)", ArgsManager::ALLOW_BOOL | ArgsManager::DEBUG_ONLY, OptionsCategory::WALLET_DEBUG_TEST); +#else + argsman.AddHiddenArgs({"-unsafesqlitesync"}); +#endif + argsman.AddArg("-walletrejectlongchains", strprintf("Wallet will not create transactions that violate mempool chain limits (default: %u)", DEFAULT_WALLET_REJECT_LONG_CHAINS), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::WALLET_DEBUG_TEST); argsman.AddHiddenArgs({"-zapwallettxes"}); |