aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/sqlite.cpp
AgeCommit message (Collapse)Author
2021-05-17wallet: refactor: dedup sqlite PRAGMA assignmentsSebastian Falbesoner
2021-05-17wallet: refactor: dedup sqlite PRAGMA integer readsSebastian Falbesoner
2021-04-12tests: Skip SQLite fsyncs while testingAndrew Chow
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.
2021-04-02wallet: refactor: dedup sqlite statement deletionsSebastian Falbesoner
2021-04-02wallet: refactor: dedup sqlite statement preparationsSebastian Falbesoner
2021-03-11scripted-diff: remove MakeUnique<T>()fanquake
-BEGIN VERIFY SCRIPT- git rm src/util/memory.h sed -i -e 's/MakeUnique/std::make_unique/g' $(git grep -l MakeUnique src) sed -i -e '/#include <util\/memory.h>/d' $(git grep -l '#include <util/memory.h>' src) sed -i -e '/util\/memory.h \\/d' src/Makefile.am -END VERIFY SCRIPT-
2020-12-04refactor: Consolidate redundant wallet database path and exists functionsRussell Yanofsky
No change in behavior. Just remove a little bit of code, reduce macro usage, remove duplicative functions, and make BDB and SQLite implementations more consistent with each other.
2020-12-04MOVEONLY: Move IsBDBFile, IsSQLiteFile, and ListWalletDirRussell Yanofsky
This commit does not change to any code and behavior. It it is easily reviewed with the --color-moved=dimmed_zebra git diff option. Motivation for this change is to: - Consolidate redundant functions IsBDBFile /ExistsBerkeleyDatabase / SplitWalletPath, and IsSQLiteFile / ExistsSQLiteDatabase in the next commits - Detect SQLite wallets consistently regardless whether bitcoin is built with SQLite support in the next commits - Avoid attempting to open SQLite databases with the BDB library when bitcoin is built without SQLite support in the next commits
2020-11-18Fix mock SQLiteDatabasesAndrew Chow
2020-11-05wallet: Set DatabaseStatus::SUCCESS in MakeSQLiteDatabaseMarcoFalke
2020-11-05Set bilingual error completelyHennadii Stepanov
2020-10-22wallet: fix buffer over-read in SQLite file magic checkSebastian Falbesoner
If there is no terminating zero within the 16 magic bytes, the buffer would be over-read in the std::string constructor. Fixed by using the "from buffer" variant of the ctor (that also takes a size) rather than the "from c-string" variant.
2020-10-14wallet: Enforce sqlite serialized threading modeAndrew Chow
2020-10-14Set and check the sqlite user versionAndrew Chow
2020-10-14Use network magic as sqlite wallet application IDAndrew Chow
2020-10-14Determine wallet file type based on file magicAndrew Chow
2020-10-14Implement SQLiteDatabase::MakeBatchAndrew Chow
2020-10-14Implement SQLiteDatabase::VerifyAndrew Chow
2020-10-14Implement SQLiteDatabase::RewriteAndrew Chow
Rewrite uses the VACUUM command which does exactly what we want. A specific advertised use case is to compact a database and ensure that any deleted data is actually deleted.
2020-10-14Implement SQLiteDatabase::TxnBegin, TxnCommit, and TxnAbortAndrew Chow
2020-10-14Implement SQLiteDatabase::BackupAndrew Chow
2020-10-14Implement SQLiteBatch::StartCursor, ReadAtCursor, and CloseCursorAndrew Chow
2020-10-14Implement SQLiteBatch::ReadKey, WriteKey, EraseKey, and HasKeyAndrew Chow
2020-10-14Add SetupSQLStatementsAndrew Chow
2020-10-14Implement SQLiteBatch::CloseAndrew Chow
2020-10-14Implement SQLiteDatabase::CloseAndrew Chow
2020-10-14Implement SQLiteDatabase::OpenAndrew Chow
2020-10-14Initialize and Shutdown sqlite3 globalsAndrew Chow
sqlite3 recommends that sqlite3_initialize be called when the application starts, and sqlite3_shutdown when it stops. Since we don't always use sqlite3, we initialize it when a SQLiteDatabse is constructed (calling sqlite3_initialize after initialized is a no-op). We call sqlite3_shutdown when we see that there are no databases opened. The number of open databases is tracked by an atomic g_dbs_open.
2020-10-14Constructors, destructors, and relevant private fields for SQLiteDatabase/BatchAndrew Chow
2020-10-14Implement SQLiteDatabaseVersionAndrew Chow
2020-10-14Add SQLiteDatabase and SQLiteBatch dummy classesAndrew Chow