aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-10-24 09:45:20 +0100
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-11-04 16:14:38 +0000
commit3958295bc8a3787b66b0269190218a3764088f79 (patch)
treeb3f83ac7db147d75056eb1110bff7f6ae27c9b0d /src/wallet
parent55295fba4cbff36e9a8c3fed9c38e82ebe3c48b7 (diff)
downloadbitcoin-3958295bc8a3787b66b0269190218a3764088f79.tar.xz
wallet: LearnRelatedScripts only if KeepDestination
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/wallet.cpp5
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();