wallet: LearnRelatedScripts only if KeepDestination

This commit is contained in:
João Barbosa committed 2019-11-04 16:14:38 +00:00
1 parent 55295fba4c
commit 3958295bc8
1 file changed
+3 -2
+3 -2
View File
@@ -3256,7 +3256,6 @@ bool ReserveDestination::GetReservedDestination(CTxDestination& dest, bool inter
fInternal = keypool.fInternal;
}
assert(vchPubKey.IsValid());
m_spk_man->LearnRelatedScripts(vchPubKey, type);
address = GetDestinationForKey(vchPubKey, type);
dest = address;
return true;
@@ -3264,8 +3263,10 @@ bool ReserveDestination::GetReservedDestination(CTxDestination& dest, bool inter
void ReserveDestination::KeepDestination()
{
if (nIndex != -1)
if (nIndex != -1) {
m_spk_man->KeepDestination(nIndex);
m_spk_man->LearnRelatedScripts(vchPubKey, type);
}
nIndex = -1;
vchPubKey = CPubKey();
address = CNoDestination();