Bitcoin ABC  0.24.7
P2P Digital Currency
walletdb.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 The Bitcoin Core developers
3 // Copyright (c) 2017-2020 The Bitcoin developers
4 // Distributed under the MIT software license, see the accompanying
5 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 
7 #ifndef BITCOIN_WALLET_WALLETDB_H
8 #define BITCOIN_WALLET_WALLETDB_H
9 
10 #include <amount.h>
11 #include <key.h>
12 #include <script/sign.h>
13 #include <script/standard.h> // for CTxDestination
14 #include <wallet/bdb.h>
15 #include <wallet/walletutil.h>
16 
17 #include <cstdint>
18 #include <string>
19 #include <vector>
20 
34 static const bool DEFAULT_FLUSHWALLET = true;
35 
36 struct CBlockLocator;
37 class CKeyPool;
38 class CMasterKey;
39 class CScript;
40 class CWallet;
41 class CWalletTx;
42 class uint160;
43 class uint256;
44 
46 enum class DBErrors {
47  LOAD_OK,
48  CORRUPT,
50  TOO_NEW,
51  LOAD_FAIL,
53 };
54 
55 namespace DBKeys {
56 extern const std::string ACENTRY;
57 extern const std::string ACTIVEEXTERNALSPK;
58 extern const std::string ACTIVEINTERNALSPK;
59 extern const std::string BESTBLOCK;
60 extern const std::string BESTBLOCK_NOMERKLE;
61 extern const std::string CRYPTED_KEY;
62 extern const std::string CSCRIPT;
63 extern const std::string DEFAULTKEY;
64 extern const std::string DESTDATA;
65 extern const std::string FLAGS;
66 extern const std::string HDCHAIN;
67 extern const std::string KEY;
68 extern const std::string KEYMETA;
69 extern const std::string MASTER_KEY;
70 extern const std::string MINVERSION;
71 extern const std::string NAME;
72 extern const std::string OLD_KEY;
73 extern const std::string ORDERPOSNEXT;
74 extern const std::string POOL;
75 extern const std::string PURPOSE;
76 extern const std::string SETTINGS;
77 extern const std::string TX;
78 extern const std::string VERSION;
79 extern const std::string WALLETDESCRIPTOR;
80 extern const std::string WALLETDESCRIPTORCACHE;
81 extern const std::string WALLETDESCRIPTORCKEY;
82 extern const std::string WALLETDESCRIPTORKEY;
83 extern const std::string WATCHMETA;
84 extern const std::string WATCHS;
85 } // namespace DBKeys
86 
87 /* simple HD chain data model */
88 class CHDChain {
89 public:
94 
95  static const int VERSION_HD_BASE = 1;
96  static const int VERSION_HD_CHAIN_SPLIT = 2;
98  int nVersion;
99 
100  CHDChain() { SetNull(); }
101 
103  READWRITE(obj.nVersion, obj.nExternalChainCounter, obj.seed_id);
104  if (obj.nVersion >= VERSION_HD_CHAIN_SPLIT) {
105  READWRITE(obj.nInternalChainCounter);
106  }
107  }
108 
109  void SetNull() {
113  seed_id.SetNull();
114  }
115 
116  bool operator==(const CHDChain &chain) const {
117  return seed_id == chain.seed_id;
118  }
119 };
120 
122 public:
123  static const int VERSION_BASIC = 1;
124  static const int VERSION_WITH_HDDATA = 10;
125  static const int VERSION_WITH_KEY_ORIGIN = 12;
127  int nVersion;
128  // 0 means unknown.
129  int64_t nCreateTime;
130  // optional HD/bip32 keypath. Still used to determine whether a key is a
131  // seed. Also kept for backwards compatibility
132  std::string hdKeypath;
133  // Id of the HD seed used to derive this key.
135  // Key origin info with path and fingerprint
138  bool has_key_origin = false;
139 
141  explicit CKeyMetadata(int64_t nCreateTime_) {
142  SetNull();
143  nCreateTime = nCreateTime_;
144  }
145 
147  READWRITE(obj.nVersion, obj.nCreateTime);
148  if (obj.nVersion >= VERSION_WITH_HDDATA) {
149  READWRITE(obj.hdKeypath, obj.hd_seed_id);
150  }
151  if (obj.nVersion >= VERSION_WITH_KEY_ORIGIN) {
152  READWRITE(obj.key_origin);
153  READWRITE(obj.has_key_origin);
154  }
155  }
156 
157  void SetNull() {
159  nCreateTime = 0;
160  hdKeypath.clear();
162  key_origin.clear();
163  has_key_origin = false;
164  }
165 };
166 
176 class WalletBatch {
177 private:
178  template <typename K, typename T>
179  bool WriteIC(const K &key, const T &value, bool fOverwrite = true) {
180  if (!m_batch->Write(key, value, fOverwrite)) {
181  return false;
182  }
184  if (m_database.nUpdateCounter % 1000 == 0) {
185  m_batch->Flush();
186  }
187  return true;
188  }
189 
190  template <typename K> bool EraseIC(const K &key) {
191  if (!m_batch->Erase(key)) {
192  return false;
193  }
195  if (m_database.nUpdateCounter % 1000 == 0) {
196  m_batch->Flush();
197  }
198  return true;
199  }
200 
201 public:
202  explicit WalletBatch(WalletDatabase &database, bool _fFlushOnClose = true)
203  : m_batch(database.MakeBatch(_fFlushOnClose)), m_database(database) {}
204  WalletBatch(const WalletBatch &) = delete;
205  WalletBatch &operator=(const WalletBatch &) = delete;
206 
207  bool WriteName(const CTxDestination &address, const std::string &strName);
208  bool EraseName(const CTxDestination &address);
209 
210  bool WritePurpose(const CTxDestination &address,
211  const std::string &purpose);
212  bool ErasePurpose(const CTxDestination &address);
213 
214  bool WriteTx(const CWalletTx &wtx);
215  bool EraseTx(uint256 hash);
216 
217  bool WriteKeyMetadata(const CKeyMetadata &meta, const CPubKey &pubkey,
218  const bool overwrite);
219  bool WriteKey(const CPubKey &vchPubKey, const CPrivKey &vchPrivKey,
220  const CKeyMetadata &keyMeta);
221  bool WriteCryptedKey(const CPubKey &vchPubKey,
222  const std::vector<uint8_t> &vchCryptedSecret,
223  const CKeyMetadata &keyMeta);
224  bool WriteMasterKey(unsigned int nID, const CMasterKey &kMasterKey);
225 
226  bool WriteCScript(const uint160 &hash, const CScript &redeemScript);
227 
228  bool WriteWatchOnly(const CScript &script, const CKeyMetadata &keymeta);
229  bool EraseWatchOnly(const CScript &script);
230 
231  bool WriteBestBlock(const CBlockLocator &locator);
232  bool ReadBestBlock(CBlockLocator &locator);
233 
234  bool WriteOrderPosNext(int64_t nOrderPosNext);
235 
236  bool ReadPool(int64_t nPool, CKeyPool &keypool);
237  bool WritePool(int64_t nPool, const CKeyPool &keypool);
238  bool ErasePool(int64_t nPool);
239 
240  bool WriteMinVersion(int nVersion);
241 
242  bool WriteDescriptorKey(const uint256 &desc_id, const CPubKey &pubkey,
243  const CPrivKey &privkey);
244  bool WriteCryptedDescriptorKey(const uint256 &desc_id,
245  const CPubKey &pubkey,
246  const std::vector<uint8_t> &secret);
247  bool WriteDescriptor(const uint256 &desc_id,
248  const WalletDescriptor &descriptor);
249  bool WriteDescriptorDerivedCache(const CExtPubKey &xpub,
250  const uint256 &desc_id,
251  uint32_t key_exp_index,
252  uint32_t der_index);
253  bool WriteDescriptorParentCache(const CExtPubKey &xpub,
254  const uint256 &desc_id,
255  uint32_t key_exp_index);
256 
258  bool WriteDestData(const CTxDestination &address, const std::string &key,
259  const std::string &value);
261  bool EraseDestData(const CTxDestination &address, const std::string &key);
262 
263  bool WriteActiveScriptPubKeyMan(uint8_t type, const uint256 &id,
264  bool internal);
265 
266  DBErrors LoadWallet(CWallet *pwallet);
267  DBErrors FindWalletTx(std::vector<TxId> &txIds, std::list<CWalletTx> &vWtx);
268  DBErrors ZapSelectTx(std::vector<TxId> &txIdsIn,
269  std::vector<TxId> &txIdsOut);
270  /* Function to determine if a certain KV/key-type is a key (cryptographical
271  * key) type */
272  static bool IsKeyType(const std::string &strType);
273 
275  bool WriteHDChain(const CHDChain &chain);
276 
277  bool WriteWalletFlags(const uint64_t flags);
279  bool TxnBegin();
281  bool TxnCommit();
283  bool TxnAbort();
284 
285 private:
286  std::unique_ptr<DatabaseBatch> m_batch;
288 };
289 
292 void MaybeCompactWalletDB();
293 
295 using KeyFilterFn = std::function<bool(const std::string &)>;
296 
298 bool ReadKeyValue(CWallet *pwallet, CDataStream &ssKey, CDataStream &ssValue,
299  std::string &strType, std::string &strErr,
300  const KeyFilterFn &filter_fn = nullptr);
301 
305 std::unique_ptr<WalletDatabase> CreateDummyWalletDatabase();
306 
308 std::unique_ptr<WalletDatabase> CreateMockWalletDatabase();
309 
310 #endif // BITCOIN_WALLET_WALLETDB_H
WalletBatch::WritePool
bool WritePool(int64_t nPool, const CKeyPool &keypool)
Definition: walletdb.cpp:201
CKeyMetadata::VERSION_BASIC
static const int VERSION_BASIC
Definition: walletdb.h:123
WalletBatch::WriteDescriptor
bool WriteDescriptor(const uint256 &desc_id, const WalletDescriptor &descriptor)
Definition: walletdb.cpp:247
WalletBatch::IsKeyType
static bool IsKeyType(const std::string &strType)
Definition: walletdb.cpp:763
CHDChain::nExternalChainCounter
uint32_t nExternalChainCounter
Definition: walletdb.h:90
DBKeys::OLD_KEY
const std::string OLD_KEY
Definition: walletdb.cpp:41
WalletBatch::WriteCScript
bool WriteCScript(const uint160 &hash, const CScript &redeemScript)
Definition: walletdb.cpp:159
DBKeys::CSCRIPT
const std::string CSCRIPT
Definition: walletdb.cpp:31
WalletBatch::m_batch
std::unique_ptr< DatabaseBatch > m_batch
Definition: walletdb.h:286
DBKeys::FLAGS
const std::string FLAGS
Definition: walletdb.cpp:34
WalletDatabase::IncrementUpdateCounter
virtual void IncrementUpdateCounter()=0
DEFAULT_FLUSHWALLET
static const bool DEFAULT_FLUSHWALLET
Overview of wallet database classes:
Definition: walletdb.h:34
DBKeys::BESTBLOCK
const std::string BESTBLOCK
Definition: walletdb.cpp:29
CKeyPool
A key from a CWallet's keypool.
Definition: scriptpubkeyman.h:106
CKeyMetadata::nVersion
int nVersion
Definition: walletdb.h:127
DBKeys::MASTER_KEY
const std::string MASTER_KEY
Definition: walletdb.cpp:38
DBErrors::NEED_REWRITE
@ NEED_REWRITE
WalletBatch::EraseTx
bool EraseTx(uint256 hash)
Definition: walletdb.cpp:103
flags
int flags
Definition: bitcoin-tx.cpp:532
DBKeys::ORDERPOSNEXT
const std::string ORDERPOSNEXT
Definition: walletdb.cpp:42
CHDChain::nVersion
int nVersion
Definition: walletdb.h:98
WalletBatch::LoadWallet
DBErrors LoadWallet(CWallet *pwallet)
Definition: walletdb.cpp:768
DBKeys::CRYPTED_KEY
const std::string CRYPTED_KEY
Definition: walletdb.cpp:30
DBKeys::WATCHS
const std::string WATCHS
Definition: walletdb.cpp:53
base_blob::SetNull
void SetNull()
Definition: uint256.h:39
WalletBatch::WriteMasterKey
bool WriteMasterKey(unsigned int nID, const CMasterKey &kMasterKey)
Definition: walletdb.cpp:154
DBErrors::NONCRITICAL_ERROR
@ NONCRITICAL_ERROR
DBKeys::WALLETDESCRIPTORCACHE
const std::string WALLETDESCRIPTORCACHE
Definition: walletdb.cpp:49
CMasterKey
Private key encryption is done based on a CMasterKey, which holds a salt and random encryption key.
Definition: crypter.h:31
CKeyMetadata::hdKeypath
std::string hdKeypath
Definition: walletdb.h:132
WalletDatabase
An instance of this class represents one database.
Definition: db.h:100
CHDChain::VERSION_HD_CHAIN_SPLIT
static const int VERSION_HD_CHAIN_SPLIT
Definition: walletdb.h:96
CKeyID
A reference to a CKey: the Hash160 of its serialized public key.
Definition: pubkey.h:22
CKeyMetadata::SERIALIZE_METHODS
SERIALIZE_METHODS(CKeyMetadata, obj)
Definition: walletdb.h:146
WalletBatch::WalletBatch
WalletBatch(WalletDatabase &database, bool _fFlushOnClose=true)
Definition: walletdb.h:202
bdb.h
WalletBatch::WriteDestData
bool WriteDestData(const CTxDestination &address, const std::string &key, const std::string &value)
Write destination data key,value tuple to database.
Definition: walletdb.cpp:1071
WalletBatch::WriteCryptedDescriptorKey
bool WriteCryptedDescriptorKey(const uint256 &desc_id, const CPubKey &pubkey, const std::vector< uint8_t > &secret)
Definition: walletdb.cpp:234
DBKeys::VERSION
const std::string VERSION
Definition: walletdb.cpp:47
DBKeys::MINVERSION
const std::string MINVERSION
Definition: walletdb.cpp:39
CPrivKey
std::vector< uint8_t, secure_allocator< uint8_t > > CPrivKey
secure_allocator is defined in allocators.h CPrivKey is a serialized private key, with all parameters...
Definition: key.h:22
WalletBatch::WriteActiveScriptPubKeyMan
bool WriteActiveScriptPubKeyMan(uint8_t type, const uint256 &id, bool internal)
Definition: walletdb.cpp:213
DBKeys::ACTIVEINTERNALSPK
const std::string ACTIVEINTERNALSPK
Definition: walletdb.cpp:27
WalletBatch::TxnCommit
bool TxnCommit()
Commit current transaction.
Definition: walletdb.cpp:1106
DBKeys::WATCHMETA
const std::string WATCHMETA
Definition: walletdb.cpp:52
WalletBatch::WriteDescriptorParentCache
bool WriteDescriptorParentCache(const CExtPubKey &xpub, const uint256 &desc_id, uint32_t key_exp_index)
Definition: walletdb.cpp:264
CreateMockWalletDatabase
std::unique_ptr< WalletDatabase > CreateMockWalletDatabase()
Return object for accessing temporary in-memory database.
Definition: walletdb.cpp:1169
DBKeys::WALLETDESCRIPTORCKEY
const std::string WALLETDESCRIPTORCKEY
Definition: walletdb.cpp:50
WalletBatch::m_database
WalletDatabase & m_database
Definition: walletdb.h:287
DBKeys::PURPOSE
const std::string PURPOSE
Definition: walletdb.cpp:44
WalletDatabase::nUpdateCounter
std::atomic< unsigned int > nUpdateCounter
Definition: db.h:156
walletutil.h
CKeyMetadata::has_key_origin
bool has_key_origin
Whether the key_origin is useful.
Definition: walletdb.h:138
CKeyMetadata::VERSION_WITH_KEY_ORIGIN
static const int VERSION_WITH_KEY_ORIGIN
Definition: walletdb.h:125
CHDChain::VERSION_HD_BASE
static const int VERSION_HD_BASE
Definition: walletdb.h:95
DBKeys::KEYMETA
const std::string KEYMETA
Definition: walletdb.cpp:36
WalletBatch::EraseIC
bool EraseIC(const K &key)
Definition: walletdb.h:190
WalletBatch::ReadPool
bool ReadPool(int64_t nPool, CKeyPool &keypool)
Definition: walletdb.cpp:197
WalletBatch::WriteOrderPosNext
bool WriteOrderPosNext(int64_t nOrderPosNext)
Definition: walletdb.cpp:193
DBKeys::POOL
const std::string POOL
Definition: walletdb.cpp:43
DBKeys::WALLETDESCRIPTOR
const std::string WALLETDESCRIPTOR
Definition: walletdb.cpp:48
WalletBatch::WriteCryptedKey
bool WriteCryptedKey(const CPubKey &vchPubKey, const std::vector< uint8_t > &vchCryptedSecret, const CKeyMetadata &keyMeta)
Definition: walletdb.cpp:129
DBKeys::BESTBLOCK_NOMERKLE
const std::string BESTBLOCK_NOMERKLE
Definition: walletdb.cpp:28
DBKeys::KEY
const std::string KEY
Definition: walletdb.cpp:37
DBKeys::SETTINGS
const std::string SETTINGS
Definition: walletdb.cpp:45
WalletBatch::EraseWatchOnly
bool EraseWatchOnly(const CScript &script)
Definition: walletdb.cpp:172
CHDChain::nInternalChainCounter
uint32_t nInternalChainCounter
Definition: walletdb.h:91
DBKeys::DEFAULTKEY
const std::string DEFAULTKEY
Definition: walletdb.cpp:32
sign.h
WalletBatch::WriteBestBlock
bool WriteBestBlock(const CBlockLocator &locator)
Definition: walletdb.cpp:179
standard.h
WalletBatch::ErasePool
bool ErasePool(int64_t nPool)
Definition: walletdb.cpp:205
WalletBatch::WriteDescriptorDerivedCache
bool WriteDescriptorDerivedCache(const CExtPubKey &xpub, const uint256 &desc_id, uint32_t key_exp_index, uint32_t der_index)
Definition: walletdb.cpp:252
KeyOriginInfo::clear
void clear()
Definition: keyorigin.h:26
uint256
256-bit opaque blob.
Definition: uint256.h:127
READWRITE
#define READWRITE(...)
Definition: serialize.h:179
DBKeys
Definition: walletdb.cpp:24
WalletBatch::EraseDestData
bool EraseDestData(const CTxDestination &address, const std::string &key)
Erase destination data tuple from wallet database.
Definition: walletdb.cpp:1084
CScript
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:430
WalletBatch::WriteHDChain
bool WriteHDChain(const CHDChain &chain)
write the hdchain model (external chain child index counter)
Definition: walletdb.cpp:1094
DBErrors::LOAD_OK
@ LOAD_OK
DBKeys::ACTIVEEXTERNALSPK
const std::string ACTIVEEXTERNALSPK
Definition: walletdb.cpp:26
ReadKeyValue
bool ReadKeyValue(CWallet *pwallet, CDataStream &ssKey, CDataStream &ssValue, std::string &strType, std::string &strErr, const KeyFilterFn &filter_fn=nullptr)
Unserialize a given Key-Value pair and load it into the wallet.
Definition: walletdb.cpp:754
CKeyMetadata::CKeyMetadata
CKeyMetadata()
Definition: walletdb.h:140
WalletBatch::ReadBestBlock
bool ReadBestBlock(CBlockLocator &locator)
Definition: walletdb.cpp:186
WalletBatch::WriteDescriptorKey
bool WriteDescriptorKey(const uint256 &desc_id, const CPubKey &pubkey, const CPrivKey &privkey)
Definition: walletdb.cpp:220
key.h
CHDChain::operator==
bool operator==(const CHDChain &chain) const
Definition: walletdb.h:116
CKeyMetadata::hd_seed_id
CKeyID hd_seed_id
Definition: walletdb.h:134
DBErrors
DBErrors
Error statuses for the wallet database.
Definition: walletdb.h:46
uint160
160-bit opaque blob.
Definition: uint256.h:115
CPubKey
An encapsulated public key.
Definition: pubkey.h:31
CreateDummyWalletDatabase
std::unique_ptr< WalletDatabase > CreateDummyWalletDatabase()
Return object for accessing dummy database with no read/write capabilities.
Definition: walletdb.cpp:1164
CHDChain::SetNull
void SetNull()
Definition: walletdb.h:109
CHDChain
Definition: walletdb.h:88
WalletBatch::ErasePurpose
bool ErasePurpose(const CTxDestination &address)
Definition: walletdb.cpp:91
WalletBatch::ZapSelectTx
DBErrors ZapSelectTx(std::vector< TxId > &txIdsIn, std::vector< TxId > &txIdsOut)
Definition: walletdb.cpp:1002
CWallet
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition: wallet.h:678
CHDChain::seed_id
CKeyID seed_id
seed hash160
Definition: walletdb.h:93
CWalletTx
A transaction with a bunch of additional info that only the owner cares about.
Definition: wallet.h:280
DBErrors::CORRUPT
@ CORRUPT
WalletBatch::WriteKeyMetadata
bool WriteKeyMetadata(const CKeyMetadata &meta, const CPubKey &pubkey, const bool overwrite)
Definition: walletdb.cpp:107
CKeyMetadata::VERSION_WITH_HDDATA
static const int VERSION_WITH_HDDATA
Definition: walletdb.h:124
CKeyMetadata::CKeyMetadata
CKeyMetadata(int64_t nCreateTime_)
Definition: walletdb.h:141
CHDChain::CURRENT_VERSION
static const int CURRENT_VERSION
Definition: walletdb.h:97
WalletBatch::WriteWatchOnly
bool WriteWatchOnly(const CScript &script, const CKeyMetadata &keymeta)
Definition: walletdb.cpp:164
CDataStream
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:197
CKeyMetadata::key_origin
KeyOriginInfo key_origin
Definition: walletdb.h:136
CKeyMetadata::nCreateTime
int64_t nCreateTime
Definition: walletdb.h:129
WalletBatch::WriteIC
bool WriteIC(const K &key, const T &value, bool fOverwrite=true)
Definition: walletdb.h:179
WalletBatch::WriteMinVersion
bool WriteMinVersion(int nVersion)
Definition: walletdb.cpp:209
WalletDescriptor
Descriptor with some wallet metadata.
Definition: walletutil.h:80
WalletBatch::operator=
WalletBatch & operator=(const WalletBatch &)=delete
CHDChain::SERIALIZE_METHODS
SERIALIZE_METHODS(CHDChain, obj)
Definition: walletdb.h:102
DBKeys::ACENTRY
const std::string ACENTRY
Definition: walletdb.cpp:25
DBKeys::HDCHAIN
const std::string HDCHAIN
Definition: walletdb.cpp:35
WalletBatch::TxnBegin
bool TxnBegin()
Begin a new transaction.
Definition: walletdb.cpp:1102
WalletBatch::WriteName
bool WriteName(const CTxDestination &address, const std::string &strName)
Definition: walletdb.cpp:60
WalletBatch::WriteTx
bool WriteTx(const CWalletTx &wtx)
Definition: walletdb.cpp:99
WalletBatch::EraseName
bool EraseName(const CTxDestination &address)
Definition: walletdb.cpp:70
CBlockLocator
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
Definition: block.h:100
CKeyMetadata::CURRENT_VERSION
static const int CURRENT_VERSION
Definition: walletdb.h:126
WalletBatch::FindWalletTx
DBErrors FindWalletTx(std::vector< TxId > &txIds, std::list< CWalletTx > &vWtx)
Definition: walletdb.cpp:950
WalletBatch::WritePurpose
bool WritePurpose(const CTxDestination &address, const std::string &purpose)
Definition: walletdb.cpp:81
WalletBatch::WriteKey
bool WriteKey(const CPubKey &vchPubKey, const CPrivKey &vchPrivKey, const CKeyMetadata &keyMeta)
Definition: walletdb.cpp:113
WalletBatch
Access to the wallet database.
Definition: walletdb.h:176
amount.h
MaybeCompactWalletDB
void MaybeCompactWalletDB()
Compacts BDB state so that wallet.dat is self-contained (if there are changes)
Definition: walletdb.cpp:1044
DBKeys::TX
const std::string TX
Definition: walletdb.cpp:46
DBKeys::NAME
const std::string NAME
Definition: walletdb.cpp:40
CExtPubKey
Definition: pubkey.h:198
CTxDestination
boost::variant< CNoDestination, PKHash, ScriptHash > CTxDestination
A txout script template with a specific destination.
Definition: standard.h:132
CKeyMetadata
Definition: walletdb.h:121
CKeyMetadata::SetNull
void SetNull()
Definition: walletdb.h:157
KeyFilterFn
std::function< bool(const std::string &)> KeyFilterFn
Callback for filtering key types to deserialize in ReadKeyValue.
Definition: walletdb.h:295
KeyOriginInfo
Definition: keyorigin.h:11
DBErrors::TOO_NEW
@ TOO_NEW
DBKeys::WALLETDESCRIPTORKEY
const std::string WALLETDESCRIPTORKEY
Definition: walletdb.cpp:51
DBErrors::LOAD_FAIL
@ LOAD_FAIL
WalletBatch::WriteWalletFlags
bool WriteWalletFlags(const uint64_t flags)
Definition: walletdb.cpp:1098
CHDChain::CHDChain
CHDChain()
Definition: walletdb.h:100
WalletBatch::TxnAbort
bool TxnAbort()
Abort current transaction.
Definition: walletdb.cpp:1110
DBKeys::DESTDATA
const std::string DESTDATA
Definition: walletdb.cpp:33