aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/sqlite.cpp
AgeCommit message (Collapse)Author
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