Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/db.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_WALLET_DB_H | #ifndef BITCOIN_WALLET_DB_H | ||||
#define BITCOIN_WALLET_DB_H | #define BITCOIN_WALLET_DB_H | ||||
#include <clientversion.h> | #include <clientversion.h> | ||||
#include <fs.h> | #include <fs.h> | ||||
#include <streams.h> | #include <streams.h> | ||||
#include <support/allocators/secure.h> | #include <support/allocators/secure.h> | ||||
#include <atomic> | #include <atomic> | ||||
#include <memory> | #include <memory> | ||||
#include <optional> | |||||
#include <string> | #include <string> | ||||
struct bilingual_str; | struct bilingual_str; | ||||
void SplitWalletPath(const fs::path &wallet_path, fs::path &env_directory, | void SplitWalletPath(const fs::path &wallet_path, fs::path &env_directory, | ||||
std::string &database_filename); | std::string &database_filename); | ||||
/** RAII class that provides access to a WalletDatabase */ | /** RAII class that provides access to a WalletDatabase */ | ||||
▲ Show 20 Lines • Show All 187 Lines • ▼ Show 20 Lines | public: | ||||
std::unique_ptr<DatabaseBatch> | std::unique_ptr<DatabaseBatch> | ||||
MakeBatch(bool flush_on_close = true) override { | MakeBatch(bool flush_on_close = true) override { | ||||
return std::make_unique<DummyBatch>(); | return std::make_unique<DummyBatch>(); | ||||
} | } | ||||
}; | }; | ||||
enum class DatabaseFormat { | enum class DatabaseFormat { | ||||
BERKELEY, | BERKELEY, | ||||
SQLITE, | |||||
}; | }; | ||||
struct DatabaseOptions { | struct DatabaseOptions { | ||||
bool require_existing = false; | bool require_existing = false; | ||||
bool require_create = false; | bool require_create = false; | ||||
std::optional<DatabaseFormat> require_format; | |||||
uint64_t create_flags = 0; | uint64_t create_flags = 0; | ||||
SecureString create_passphrase; | SecureString create_passphrase; | ||||
bool verify = true; | bool verify = true; | ||||
}; | }; | ||||
enum class DatabaseStatus { | enum class DatabaseStatus { | ||||
SUCCESS, | SUCCESS, | ||||
FAILED_BAD_PATH, | FAILED_BAD_PATH, | ||||
Show All 16 Lines |