mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-04 04:45:10 +02:00
Key pool: Move LearnRelated and GetDestination calls
Addresses are determined by LegacyScriptPubKeyMan::GetReservedDestination instead of ReserveDestination::GetReservedDestination as other ScriptPubKeyMan implementations may construct addresses differently This does not change behavior.
This commit is contained in:
@@ -3302,14 +3302,13 @@ bool ReserveDestination::GetReservedDestination(CTxDestination& dest, bool inter
|
||||
if (nIndex == -1)
|
||||
{
|
||||
CKeyPool keypool;
|
||||
if (!m_spk_man->GetReservedDestination(type, internal, nIndex, keypool)) {
|
||||
if (!m_spk_man->GetReservedDestination(type, internal, address, nIndex, keypool)) {
|
||||
return false;
|
||||
}
|
||||
vchPubKey = keypool.vchPubKey;
|
||||
fInternal = keypool.fInternal;
|
||||
}
|
||||
assert(vchPubKey.IsValid());
|
||||
address = GetDestinationForKey(vchPubKey, type);
|
||||
dest = address;
|
||||
return true;
|
||||
}
|
||||
@@ -3318,7 +3317,6 @@ void ReserveDestination::KeepDestination()
|
||||
{
|
||||
if (nIndex != -1) {
|
||||
m_spk_man->KeepDestination(nIndex, type, vchPubKey);
|
||||
m_spk_man->LearnRelatedScripts(vchPubKey, type);
|
||||
}
|
||||
nIndex = -1;
|
||||
vchPubKey = CPubKey();
|
||||
|
||||
Reference in New Issue
Block a user