Skip to content

Commit 9fcf8ce

Browse files
committed
Rename Keep/ReturnKey to Keep/ReturnDestination and remove the wrapper
There is no reason to have Keep/ReturnDestination to be a wrapper for Keep/ReturnKey. Instead just make them the same function.
1 parent 596f646 commit 9fcf8ce

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

src/wallet/scriptpubkeyman.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,6 @@ bool LegacyScriptPubKeyMan::GetReservedDestination(const OutputType type, bool i
274274
return true;
275275
}
276276

277-
void LegacyScriptPubKeyMan::KeepDestination(int64_t index)
278-
{
279-
KeepKey(index);
280-
}
281-
282-
void LegacyScriptPubKeyMan::ReturnDestination(int64_t index, bool internal, const CPubKey& pubkey)
283-
{
284-
ReturnKey(index, internal, pubkey);
285-
}
286-
287277
void LegacyScriptPubKeyMan::MarkUnusedAddresses(const CScript& script)
288278
{
289279
AssertLockHeld(cs_wallet);
@@ -1096,15 +1086,15 @@ void LegacyScriptPubKeyMan::AddKeypoolPubkeyWithDB(const CPubKey& pubkey, const
10961086
m_pool_key_to_index[pubkey.GetID()] = index;
10971087
}
10981088

1099-
void LegacyScriptPubKeyMan::KeepKey(int64_t nIndex)
1089+
void LegacyScriptPubKeyMan::KeepDestination(int64_t nIndex)
11001090
{
11011091
// Remove from key pool
11021092
WalletBatch batch(m_storage.GetDatabase());
11031093
batch.ErasePool(nIndex);
11041094
WalletLogPrintf("keypool keep %d\n", nIndex);
11051095
}
11061096

1107-
void LegacyScriptPubKeyMan::ReturnKey(int64_t nIndex, bool fInternal, const CPubKey& pubkey)
1097+
void LegacyScriptPubKeyMan::ReturnDestination(int64_t nIndex, bool fInternal, const CPubKey& pubkey)
11081098
{
11091099
// Return to key pool
11101100
{
@@ -1138,7 +1128,7 @@ bool LegacyScriptPubKeyMan::GetKeyFromPool(CPubKey& result, bool internal)
11381128
result = GenerateNewKey(batch, internal);
11391129
return true;
11401130
}
1141-
KeepKey(nIndex);
1131+
KeepDestination(nIndex);
11421132
result = keypool.vchPubKey;
11431133
}
11441134
return true;

src/wallet/scriptpubkeyman.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,6 @@ class LegacyScriptPubKeyMan : public ScriptPubKeyMan, public FillableSigningProv
266266
*/
267267
bool ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool, bool fRequestedInternal);
268268

269-
void KeepKey(int64_t nIndex);
270-
void ReturnKey(int64_t nIndex, bool fInternal, const CPubKey& pubkey);
271-
272269
public:
273270
bool GetNewDestination(const OutputType type, CTxDestination& dest, std::string& error) override;
274271
isminetype IsMine(const CScript& script) const override;

0 commit comments

Comments
 (0)