Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 702 Lines • ▼ Show 20 Lines | public: | ||||
std::string ToString() const; | std::string ToString() const; | ||||
inline CInputCoin GetInputCoin() const { | inline CInputCoin GetInputCoin() const { | ||||
return CInputCoin(tx->tx, i, nInputBytes); | return CInputCoin(tx->tx, i, nInputBytes); | ||||
} | } | ||||
}; | }; | ||||
/** Private key that includes an expiration date in case it never gets used. */ | /** | ||||
class CWalletKey { | * Private key that was serialized by an old wallet (only used for | ||||
public: | * deserialization) */ | ||||
struct OldKey { | |||||
CPrivKey vchPrivKey; | CPrivKey vchPrivKey; | ||||
int64_t nTimeCreated; | |||||
int64_t nTimeExpires; | |||||
std::string strComment; | |||||
// todo: add something to note what created it (user, getnewaddress, | |||||
// change) maybe should have a map<string, string> property map | |||||
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) { | ||||
// no longer used by the wallet, thus dropped after deserialization: | |||||
int64_t nTimeCreated; | |||||
int64_t nTimeExpires; | |||||
std::string strComment; | |||||
int nVersion = s.GetVersion(); | int nVersion = s.GetVersion(); | ||||
if (!(s.GetType() & SER_GETHASH)) { | if (!(s.GetType() & SER_GETHASH)) { | ||||
READWRITE(nVersion); | READWRITE(nVersion); | ||||
} | } | ||||
READWRITE(vchPrivKey); | READWRITE(vchPrivKey); | ||||
READWRITE(nTimeCreated); | READWRITE(nTimeCreated); | ||||
READWRITE(nTimeExpires); | READWRITE(nTimeExpires); | ||||
READWRITE(LIMITED_STRING(strComment, 65536)); | READWRITE(LIMITED_STRING(strComment, 65536)); | ||||
▲ Show 20 Lines • Show All 985 Lines • Show Last 20 Lines |