Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletmodel.h
Show First 20 Lines • Show All 195 Lines • ▼ Show 20 Lines | public: | ||||
// RAI object for unlocking wallet, returned by requestUnlock() | // RAI object for unlocking wallet, returned by requestUnlock() | ||||
class UnlockContext { | class UnlockContext { | ||||
public: | public: | ||||
UnlockContext(WalletModel *wallet, bool valid, bool relock); | UnlockContext(WalletModel *wallet, bool valid, bool relock); | ||||
~UnlockContext(); | ~UnlockContext(); | ||||
bool isValid() const { return valid; } | bool isValid() const { return valid; } | ||||
// Copy operator and constructor transfer the context | // Copy constructor is disabled. | ||||
UnlockContext(const UnlockContext &obj) { CopyFrom(obj); } | UnlockContext(const UnlockContext &) = delete; | ||||
UnlockContext &operator=(const UnlockContext &rhs) { | // Move operator and constructor transfer the context | ||||
CopyFrom(rhs); | UnlockContext(UnlockContext &&obj) { CopyFrom(std::move(obj)); } | ||||
UnlockContext &operator=(UnlockContext &&rhs) { | |||||
CopyFrom(std::move(rhs)); | |||||
return *this; | return *this; | ||||
} | } | ||||
private: | private: | ||||
WalletModel *wallet; | WalletModel *wallet; | ||||
bool valid; | bool valid; | ||||
// mutable, as it can be set to false by copying | // mutable, as it can be set to false by copying | ||||
mutable bool relock; | mutable bool relock; | ||||
void CopyFrom(const UnlockContext &rhs); | UnlockContext &operator=(const UnlockContext &) = default; | ||||
void CopyFrom(UnlockContext &&rhs); | |||||
}; | }; | ||||
UnlockContext requestUnlock(); | UnlockContext requestUnlock(); | ||||
void loadReceiveRequests(std::vector<std::string> &vReceiveRequests); | void loadReceiveRequests(std::vector<std::string> &vReceiveRequests); | ||||
bool saveReceiveRequest(const std::string &sAddress, const int64_t nId, | bool saveReceiveRequest(const std::string &sAddress, const int64_t nId, | ||||
const std::string &sRequest); | const std::string &sRequest); | ||||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |