Skip to content

Commit ef2d515

Browse files
committed
[wallet] move-only: move CReserveKey to be next to CKeyPool
reviewer tip: use git diff --color-moved=dimmed-zebra
1 parent adc55db commit ef2d515

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

src/wallet/wallet.h

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,34 @@ class CKeyPool
181181
}
182182
};
183183

184+
/** A key allocated from the key pool. */
185+
class CReserveKey
186+
{
187+
protected:
188+
CWallet* pwallet;
189+
int64_t nIndex{-1};
190+
CPubKey vchPubKey;
191+
bool fInternal{false};
192+
193+
public:
194+
explicit CReserveKey(CWallet* pwalletIn)
195+
{
196+
pwallet = pwalletIn;
197+
}
198+
199+
CReserveKey(const CReserveKey&) = delete;
200+
CReserveKey& operator=(const CReserveKey&) = delete;
201+
202+
~CReserveKey()
203+
{
204+
ReturnKey();
205+
}
206+
207+
void ReturnKey();
208+
bool GetReservedKey(CPubKey &pubkey, bool internal = false);
209+
void KeepKey();
210+
};
211+
184212
/** Address book data */
185213
class CAddressBookData
186214
{
@@ -1218,34 +1246,6 @@ class CWallet final : public CCryptoKeyStore, private interfaces::Chain::Notific
12181246
*/
12191247
void MaybeResendWalletTxs();
12201248

1221-
/** A key allocated from the key pool. */
1222-
class CReserveKey
1223-
{
1224-
protected:
1225-
CWallet* pwallet;
1226-
int64_t nIndex{-1};
1227-
CPubKey vchPubKey;
1228-
bool fInternal{false};
1229-
1230-
public:
1231-
explicit CReserveKey(CWallet* pwalletIn)
1232-
{
1233-
pwallet = pwalletIn;
1234-
}
1235-
1236-
CReserveKey(const CReserveKey&) = delete;
1237-
CReserveKey& operator=(const CReserveKey&) = delete;
1238-
1239-
~CReserveKey()
1240-
{
1241-
ReturnKey();
1242-
}
1243-
1244-
void ReturnKey();
1245-
bool GetReservedKey(CPubKey &pubkey, bool internal = false);
1246-
void KeepKey();
1247-
};
1248-
12491249
/** RAII object to check and reserve a wallet rescan */
12501250
class WalletRescanReserver
12511251
{

0 commit comments

Comments
 (0)