mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Add OutputType and CPubKey parameters to KeepDestination
These need to be added so that LearnRelatedScripts can be called from within KeepDestination later.
This commit is contained in:
@@ -18,7 +18,7 @@ bool LegacyScriptPubKeyMan::GetNewDestination(const OutputType type, CTxDestinat
|
||||
|
||||
// Generate a new key that is added to wallet
|
||||
CPubKey new_key;
|
||||
if (!GetKeyFromPool(new_key)) {
|
||||
if (!GetKeyFromPool(new_key, type)) {
|
||||
error = "Error: Keypool ran out, please call keypoolrefill first";
|
||||
return false;
|
||||
}
|
||||
@@ -1086,7 +1086,7 @@ void LegacyScriptPubKeyMan::AddKeypoolPubkeyWithDB(const CPubKey& pubkey, const
|
||||
m_pool_key_to_index[pubkey.GetID()] = index;
|
||||
}
|
||||
|
||||
void LegacyScriptPubKeyMan::KeepDestination(int64_t nIndex)
|
||||
void LegacyScriptPubKeyMan::KeepDestination(int64_t nIndex, const OutputType& type, const CPubKey& pubkey)
|
||||
{
|
||||
// Remove from key pool
|
||||
WalletBatch batch(m_storage.GetDatabase());
|
||||
@@ -1112,7 +1112,7 @@ void LegacyScriptPubKeyMan::ReturnDestination(int64_t nIndex, bool fInternal, co
|
||||
WalletLogPrintf("keypool return %d\n", nIndex);
|
||||
}
|
||||
|
||||
bool LegacyScriptPubKeyMan::GetKeyFromPool(CPubKey& result, bool internal)
|
||||
bool LegacyScriptPubKeyMan::GetKeyFromPool(CPubKey& result, const OutputType type, bool internal)
|
||||
{
|
||||
if (!CanGetAddresses(internal)) {
|
||||
return false;
|
||||
@@ -1128,7 +1128,7 @@ bool LegacyScriptPubKeyMan::GetKeyFromPool(CPubKey& result, bool internal)
|
||||
result = GenerateNewKey(batch, internal);
|
||||
return true;
|
||||
}
|
||||
KeepDestination(nIndex);
|
||||
KeepDestination(nIndex, type, keypool.vchPubKey);
|
||||
result = keypool.vchPubKey;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user