Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.cpp
Show All 12 Lines | |||||
#include <serialize.h> | #include <serialize.h> | ||||
#include <sync.h> | #include <sync.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <util/time.h> | #include <util/time.h> | ||||
#include <wallet/wallet.h> | #include <wallet/wallet.h> | ||||
#include <atomic> | #include <atomic> | ||||
namespace DBKeys { | |||||
const std::string ACENTRY{"acentry"}; | |||||
const std::string ACTIVEEXTERNALSPK{"activeexternalspk"}; | |||||
const std::string ACTIVEINTERNALSPK{"activeinternalspk"}; | |||||
const std::string BESTBLOCK_NOMERKLE{"bestblock_nomerkle"}; | |||||
const std::string BESTBLOCK{"bestblock"}; | |||||
const std::string CRYPTED_KEY{"ckey"}; | |||||
const std::string CSCRIPT{"cscript"}; | |||||
const std::string DEFAULTKEY{"defaultkey"}; | |||||
const std::string DESTDATA{"destdata"}; | |||||
const std::string FLAGS{"flags"}; | |||||
const std::string HDCHAIN{"hdchain"}; | |||||
const std::string KEYMETA{"keymeta"}; | |||||
const std::string KEY{"key"}; | |||||
const std::string MASTER_KEY{"mkey"}; | |||||
const std::string MINVERSION{"minversion"}; | |||||
const std::string NAME{"name"}; | |||||
const std::string OLD_KEY{"wkey"}; | |||||
const std::string ORDERPOSNEXT{"orderposnext"}; | |||||
const std::string POOL{"pool"}; | |||||
const std::string PURPOSE{"purpose"}; | |||||
const std::string SETTINGS{"settings"}; | |||||
const std::string TX{"tx"}; | |||||
const std::string VERSION{"version"}; | |||||
const std::string WALLETDESCRIPTOR{"walletdescriptor"}; | |||||
const std::string WALLETDESCRIPTORCACHE{"walletdescriptorcache"}; | |||||
const std::string WALLETDESCRIPTORCKEY{"walletdescriptorckey"}; | |||||
const std::string WALLETDESCRIPTORKEY{"walletdescriptorkey"}; | |||||
const std::string WATCHMETA{"watchmeta"}; | |||||
const std::string WATCHS{"watchs"}; | |||||
} // namespace DBKeys | |||||
// | // | ||||
// WalletBatch | // WalletBatch | ||||
// | // | ||||
bool WalletBatch::WriteName(const CTxDestination &address, | bool WalletBatch::WriteName(const CTxDestination &address, | ||||
const std::string &strName) { | const std::string &strName) { | ||||
if (!IsValidDestination(address)) { | if (!IsValidDestination(address)) { | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
bool WalletBatch::WriteMinVersion(int nVersion) { | bool WalletBatch::WriteMinVersion(int nVersion) { | ||||
return WriteIC(DBKeys::MINVERSION, nVersion); | return WriteIC(DBKeys::MINVERSION, nVersion); | ||||
} | } | ||||
bool WalletBatch::WriteActiveScriptPubKeyMan(uint8_t type, const uint256 &id, | bool WalletBatch::WriteActiveScriptPubKeyMan(uint8_t type, const uint256 &id, | ||||
bool internal) { | bool internal) { | ||||
std::string key = | const auto key = | ||||
internal ? DBKeys::ACTIVEINTERNALSPK : DBKeys::ACTIVEEXTERNALSPK; | internal ? DBKeys::ACTIVEINTERNALSPK : DBKeys::ACTIVEEXTERNALSPK; | ||||
return WriteIC(make_pair(key, type), id); | return WriteIC(make_pair(key, type), id); | ||||
} | } | ||||
bool WalletBatch::WriteDescriptorKey(const uint256 &desc_id, | bool WalletBatch::WriteDescriptorKey(const uint256 &desc_id, | ||||
const CPubKey &pubkey, | const CPubKey &pubkey, | ||||
const CPrivKey &privkey) { | const CPrivKey &privkey) { | ||||
// hash pubkey/privkey to accelerate wallet load | // hash pubkey/privkey to accelerate wallet load | ||||
▲ Show 20 Lines • Show All 798 Lines • Show Last 20 Lines |