Skip to content

Commit

Permalink
wallet: LearnRelatedScripts only if KeepDestination
Browse files Browse the repository at this point in the history
  • Loading branch information
promag committed Nov 4, 2019
1 parent 55295fb commit 3958295
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3256,16 +3256,17 @@ 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;
}

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();
Expand Down

0 comments on commit 3958295

Please sign in to comment.