File tree Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -477,13 +477,6 @@ WalletModel::UnlockContext::~UnlockContext()
477
477
}
478
478
}
479
479
480
- void WalletModel::UnlockContext::CopyFrom (UnlockContext&& rhs)
481
- {
482
- // Transfer context; old object no longer relocks wallet
483
- *this = rhs;
484
- rhs.relock = false ;
485
- }
486
-
487
480
bool WalletModel::bumpFee (uint256 hash, uint256& new_hash)
488
481
{
489
482
CCoinControl coin_control;
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ class WalletModel : public QObject
111
111
bool setWalletLocked (bool locked, const SecureString &passPhrase=SecureString());
112
112
bool changePassphrase (const SecureString &oldPass, const SecureString &newPass);
113
113
114
- // RAI object for unlocking wallet, returned by requestUnlock()
114
+ // RAII object for unlocking wallet, returned by requestUnlock()
115
115
class UnlockContext
116
116
{
117
117
public:
@@ -120,18 +120,16 @@ class WalletModel : public QObject
120
120
121
121
bool isValid () const { return valid; }
122
122
123
- // Copy constructor is disabled .
123
+ // Disable unused copy/move constructors/assignments explicitly .
124
124
UnlockContext (const UnlockContext&) = delete ;
125
- // Move operator and constructor transfer the context
126
- UnlockContext (UnlockContext&& obj) { CopyFrom (std::move (obj)); }
127
- UnlockContext& operator =(UnlockContext&& rhs) { CopyFrom (std::move (rhs)); return *this ; }
125
+ UnlockContext (UnlockContext&&) = delete ;
126
+ UnlockContext& operator =(const UnlockContext&) = delete ;
127
+ UnlockContext& operator =(UnlockContext&&) = delete ;
128
+
128
129
private:
129
130
WalletModel *wallet;
130
- bool valid;
131
- mutable bool relock; // mutable, as it can be set to false by copying
132
-
133
- UnlockContext& operator =(const UnlockContext&) = default ;
134
- void CopyFrom (UnlockContext&& rhs);
131
+ const bool valid;
132
+ const bool relock;
135
133
};
136
134
137
135
UnlockContext requestUnlock ();
You can’t perform that action at this time.
0 commit comments