diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-10-24 09:45:20 +0100 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-11-04 16:14:38 +0000 |
commit | 3958295bc8a3787b66b0269190218a3764088f79 (patch) | |
tree | b3f83ac7db147d75056eb1110bff7f6ae27c9b0d /src/wallet | |
parent | 55295fba4cbff36e9a8c3fed9c38e82ebe3c48b7 (diff) | |
download | bitcoin-3958295bc8a3787b66b0269190218a3764088f79.tar.xz |
wallet: LearnRelatedScripts only if KeepDestination
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/wallet.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index f1e432f2e7..6dc5d403ca 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -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(); |