mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-25 01:51:04 +02:00
Return nullptr from GetLegacyScriptPubKeyMan if descriptor wallet
This commit is contained in:
@@ -4353,6 +4353,9 @@ std::unique_ptr<SigningProvider> CWallet::GetSolvingProvider(const CScript& scri
|
|||||||
|
|
||||||
LegacyScriptPubKeyMan* CWallet::GetLegacyScriptPubKeyMan() const
|
LegacyScriptPubKeyMan* CWallet::GetLegacyScriptPubKeyMan() const
|
||||||
{
|
{
|
||||||
|
if (IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
// Legacy wallets only have one ScriptPubKeyMan which is a LegacyScriptPubKeyMan.
|
// Legacy wallets only have one ScriptPubKeyMan which is a LegacyScriptPubKeyMan.
|
||||||
// Everything in m_internal_spk_managers and m_external_spk_managers point to the same legacyScriptPubKeyMan.
|
// Everything in m_internal_spk_managers and m_external_spk_managers point to the same legacyScriptPubKeyMan.
|
||||||
auto it = m_internal_spk_managers.find(OutputType::LEGACY);
|
auto it = m_internal_spk_managers.find(OutputType::LEGACY);
|
||||||
@@ -4368,7 +4371,7 @@ LegacyScriptPubKeyMan* CWallet::GetOrCreateLegacyScriptPubKeyMan()
|
|||||||
|
|
||||||
void CWallet::SetupLegacyScriptPubKeyMan()
|
void CWallet::SetupLegacyScriptPubKeyMan()
|
||||||
{
|
{
|
||||||
if (!m_internal_spk_managers.empty() || !m_external_spk_managers.empty() || !m_spk_managers.empty()) {
|
if (!m_internal_spk_managers.empty() || !m_external_spk_managers.empty() || !m_spk_managers.empty() || IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user