Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show All 32 Lines | |||||
#include <memory> | #include <memory> | ||||
#include <set> | #include <set> | ||||
#include <stdexcept> | #include <stdexcept> | ||||
#include <string> | #include <string> | ||||
#include <utility> | #include <utility> | ||||
#include <vector> | #include <vector> | ||||
//! Explicitly unload and delete the wallet. | //! Explicitly unload and delete the wallet. | ||||
// Blocks the current thread after signaling the unload intent so that all | //! Blocks the current thread after signaling the unload intent so that all | ||||
// wallet clients release the wallet. | //! wallet clients release the wallet. | ||||
// Note that, when blocking is not required, the wallet is implicitly unloaded | //! Note that, when blocking is not required, the wallet is implicitly unloaded | ||||
// by the shared pointer deleter. | //! by the shared pointer deleter. | ||||
void UnloadWallet(std::shared_ptr<CWallet> &&wallet); | void UnloadWallet(std::shared_ptr<CWallet> &&wallet); | ||||
bool AddWallet(const std::shared_ptr<CWallet> &wallet); | bool AddWallet(const std::shared_ptr<CWallet> &wallet); | ||||
bool RemoveWallet(const std::shared_ptr<CWallet> &wallet); | bool RemoveWallet(const std::shared_ptr<CWallet> &wallet); | ||||
bool HasWallets(); | bool HasWallets(); | ||||
std::vector<std::shared_ptr<CWallet>> GetWallets(); | std::vector<std::shared_ptr<CWallet>> GetWallets(); | ||||
std::shared_ptr<CWallet> GetWallet(const std::string &name); | std::shared_ptr<CWallet> GetWallet(const std::string &name); | ||||
std::shared_ptr<CWallet> LoadWallet(const CChainParams &chainParams, | std::shared_ptr<CWallet> LoadWallet(const CChainParams &chainParams, | ||||
▲ Show 20 Lines • Show All 654 Lines • ▼ Show 20 Lines | |||||
/** Private key that includes an expiration date in case it never gets used. */ | /** Private key that includes an expiration date in case it never gets used. */ | ||||
class CWalletKey { | class CWalletKey { | ||||
public: | public: | ||||
CPrivKey vchPrivKey; | CPrivKey vchPrivKey; | ||||
int64_t nTimeCreated; | int64_t nTimeCreated; | ||||
int64_t nTimeExpires; | int64_t nTimeExpires; | ||||
std::string strComment; | std::string strComment; | ||||
//! todo: add something to note what created it (user, getnewaddress, | // todo: add something to note what created it (user, getnewaddress, | ||||
//! change) maybe should have a map<string, string> property map | // change) maybe should have a map<string, string> property map | ||||
explicit CWalletKey(int64_t nExpires = 0); | explicit CWalletKey(int64_t nExpires = 0); | ||||
ADD_SERIALIZE_METHODS; | ADD_SERIALIZE_METHODS; | ||||
template <typename Stream, typename Operation> | template <typename Stream, typename Operation> | ||||
inline void SerializationOp(Stream &s, Operation ser_action) { | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
int nVersion = s.GetVersion(); | int nVersion = s.GetVersion(); | ||||
▲ Show 20 Lines • Show All 933 Lines • Show Last 20 Lines |