Merge bitcoin/bitcoin#27274: refactor: remove unused param from legacy pubkey interface

1869310f3c refactor: remove unused param from legacy pubkey (Bushstar)

Pull request description:

  Unused param present in legacy pubkey manager interface. This param will not be used and should be removed to prevent unintended usage.

ACKs for top commit:
  Sjors:
    ACK 1869310f3c
  furszy:
    ACK 1869310f3c

Tree-SHA512: 0fb41fc8f481f859262f2e8e9a93c990c1b4637e74fd9191ccc0b3c523d0e7d94217a3074bb357276e1941a10d29326f850f9b27eccc1eca57cf6b549353400c
This commit is contained in:
fanquake 2023-03-31 16:56:51 +01:00
commit a0d37d1d23
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1
2 changed files with 5 additions and 5 deletions

View file

@ -1385,10 +1385,10 @@ void LegacyScriptPubKeyMan::ReturnDestination(int64_t nIndex, bool fInternal, co
WalletLogPrintf("keypool return %d\n", nIndex);
}
bool LegacyScriptPubKeyMan::GetKeyFromPool(CPubKey& result, const OutputType type, bool internal)
bool LegacyScriptPubKeyMan::GetKeyFromPool(CPubKey& result, const OutputType type)
{
assert(type != OutputType::BECH32M);
if (!CanGetAddresses(internal)) {
if (!CanGetAddresses(/*internal=*/ false)) {
return false;
}
@ -1396,10 +1396,10 @@ bool LegacyScriptPubKeyMan::GetKeyFromPool(CPubKey& result, const OutputType typ
{
LOCK(cs_KeyStore);
int64_t nIndex;
if (!ReserveKeyFromKeyPool(nIndex, keypool, internal) && !m_storage.IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
if (!ReserveKeyFromKeyPool(nIndex, keypool, /*fRequestedInternal=*/ false) && !m_storage.IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
if (m_storage.IsLocked()) return false;
WalletBatch batch(m_storage.GetDatabase());
result = GenerateNewKey(batch, m_hd_chain, internal);
result = GenerateNewKey(batch, m_hd_chain, /*internal=*/ false);
return true;
}
KeepDestination(nIndex, type);

View file

@ -334,7 +334,7 @@ private:
std::map<int64_t, CKeyID> m_index_to_reserved_key;
//! Fetches a key from the keypool
bool GetKeyFromPool(CPubKey &key, const OutputType type, bool internal = false);
bool GetKeyFromPool(CPubKey &key, const OutputType type);
/**
* Reserves a key from the keypool and sets nIndex to its index