Refactor: Move SetAddressBook call out of LegacyScriptPubKeyMan::GetNewDestination

This commit does not change behavior.
This commit is contained in:
Andrew Chow
2019-10-07 14:11:34 -04:00
parent acedc5b823
commit 769acef857
3 changed files with 9 additions and 6 deletions

View File

@@ -3034,12 +3034,17 @@ bool CWallet::TopUpKeyPool(unsigned int kpSize)
bool CWallet::GetNewDestination(const OutputType type, const std::string label, CTxDestination& dest, std::string& error)
{
LOCK(cs_wallet);
error.clear();
bool result = false;
auto spk_man = m_spk_man.get();
if (spk_man) {
result = spk_man->GetNewDestination(type, label, dest, error);
result = spk_man->GetNewDestination(type, dest, error);
}
if (result) {
SetAddressBook(dest, label, "receive");
}
return result;
}