Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | public: | ||||
*/ | */ | ||||
int nIndex; | int nIndex; | ||||
CMerkleTx() { | CMerkleTx() { | ||||
SetTx(MakeTransactionRef()); | SetTx(MakeTransactionRef()); | ||||
Init(); | Init(); | ||||
} | } | ||||
CMerkleTx(CTransactionRef arg) { | explicit CMerkleTx(CTransactionRef arg) { | ||||
SetTx(std::move(arg)); | SetTx(std::move(arg)); | ||||
Init(); | Init(); | ||||
} | } | ||||
/** | /** | ||||
* Helper conversion operator to allow passing CMerkleTx where CTransaction | * Helper conversion operator to allow passing CMerkleTx where CTransaction | ||||
* is expected. | * is expected. | ||||
* TODO: adapt callers and remove this operator. | * TODO: adapt callers and remove this operator. | ||||
▲ Show 20 Lines • Show All 282 Lines • ▼ Show 20 Lines | |||||
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 | ||||
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(); | ||||
if (!(s.GetType() & SER_GETHASH)) READWRITE(nVersion); | if (!(s.GetType() & SER_GETHASH)) READWRITE(nVersion); | ||||
READWRITE(vchPrivKey); | READWRITE(vchPrivKey); | ||||
▲ Show 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | public: | ||||
// key metadata. | // key metadata. | ||||
std::map<CTxDestination, CKeyMetadata> mapKeyMetadata; | std::map<CTxDestination, CKeyMetadata> mapKeyMetadata; | ||||
typedef std::map<unsigned int, CMasterKey> MasterKeyMap; | typedef std::map<unsigned int, CMasterKey> MasterKeyMap; | ||||
MasterKeyMap mapMasterKeys; | MasterKeyMap mapMasterKeys; | ||||
unsigned int nMasterKeyMaxID; | unsigned int nMasterKeyMaxID; | ||||
// Create wallet with dummy database handle | // Create wallet with dummy database handle | ||||
CWallet(const CChainParams &chainParamsIn) | explicit CWallet(const CChainParams &chainParamsIn) | ||||
: dbw(new CWalletDBWrapper()), chainParams(chainParamsIn) { | : dbw(new CWalletDBWrapper()), chainParams(chainParamsIn) { | ||||
SetNull(); | SetNull(); | ||||
} | } | ||||
// Create wallet with passed-in database handle | // Create wallet with passed-in database handle | ||||
CWallet(const CChainParams &chainParamsIn, | CWallet(const CChainParams &chainParamsIn, | ||||
std::unique_ptr<CWalletDBWrapper> dbw_in) | std::unique_ptr<CWalletDBWrapper> dbw_in) | ||||
: dbw(std::move(dbw_in)), chainParams(chainParamsIn) { | : dbw(std::move(dbw_in)), chainParams(chainParamsIn) { | ||||
▲ Show 20 Lines • Show All 409 Lines • ▼ Show 20 Lines | |||||
class CReserveKey final : public CReserveScript { | class CReserveKey final : public CReserveScript { | ||||
protected: | protected: | ||||
CWallet *pwallet; | CWallet *pwallet; | ||||
int64_t nIndex; | int64_t nIndex; | ||||
CPubKey vchPubKey; | CPubKey vchPubKey; | ||||
bool fInternal; | bool fInternal; | ||||
public: | public: | ||||
CReserveKey(CWallet *pwalletIn) { | explicit CReserveKey(CWallet *pwalletIn) { | ||||
nIndex = -1; | nIndex = -1; | ||||
pwallet = pwalletIn; | pwallet = pwalletIn; | ||||
fInternal = false; | fInternal = false; | ||||
} | } | ||||
~CReserveKey() { ReturnKey(); } | ~CReserveKey() { ReturnKey(); } | ||||
void ReturnKey(); | void ReturnKey(); | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |