Skip to content

Commit 3958295

Browse files
committed
wallet: LearnRelatedScripts only if KeepDestination
1 parent 55295fb commit 3958295

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3256,16 +3256,17 @@ bool ReserveDestination::GetReservedDestination(CTxDestination& dest, bool inter
32563256
fInternal = keypool.fInternal;
32573257
}
32583258
assert(vchPubKey.IsValid());
3259-
m_spk_man->LearnRelatedScripts(vchPubKey, type);
32603259
address = GetDestinationForKey(vchPubKey, type);
32613260
dest = address;
32623261
return true;
32633262
}
32643263

32653264
void ReserveDestination::KeepDestination()
32663265
{
3267-
if (nIndex != -1)
3266+
if (nIndex != -1) {
32683267
m_spk_man->KeepDestination(nIndex);
3268+
m_spk_man->LearnRelatedScripts(vchPubKey, type);
3269+
}
32693270
nIndex = -1;
32703271
vchPubKey = CPubKey();
32713272
address = CNoDestination();

0 commit comments

Comments
 (0)