mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 05:32:22 +02:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user