miniscript: Don't use StringType::COMPAT

Previous versions did not pass down StringType::COMPAT when that was
given as the serialization string type. As COMPAT is used for descriptor
id calculation, we need to maintain the previous (incorrect) behavior of
not passing StringType::COMPAT.
This commit is contained in:
Ava Chow
2026-06-01 13:00:53 -07:00
parent 6a028161da
commit 1c7f9aaf75

View File

@@ -1661,7 +1661,11 @@ public:
if (!m_pubkeys[key]->ToNormalizedString(*m_arg, ret, m_cache)) return {};
break;
case DescriptorImpl::StringType::COMPAT:
ret = m_pubkeys[key]->ToString(PubkeyProvider::StringType::COMPAT);
// For backwards compatibility, we do not pass StringType::COMPAT.
// Prior to 31.0, COMPAT was not provided, so PUBLIC was in use. From this string,
// DescriptorSPKM IDs were computed from this string, so the incorrect behavior
// must be preserved for wallets with Miniscript descriptors to be loaded
ret = m_pubkeys[key]->ToString();
break;
}
return ret;