Skip to main content

validate_multipath_consistency

Function validate_multipath_consistency 

Source
pub fn validate_multipath_consistency(
    shared: &UseSitePath,
    overrides: &[(u8, UseSitePath)],
) -> Result<(), Error>
Expand description

Validate that all multipaths in shared default + overrides share the same alt-count.

Per spec §7, when multiple UseSitePath entries (the shared default plus any per-@N overrides) carry a multipath group, all groups MUST have the same number of alternatives.

D5(b): a Some-multipath baseline mixed with a None-multipath override (or vice-versa) is a legal divergent STRUCTURE (e.g. @0/<0;1>/* + @1/*), NOT a reject — a None entry simply carries no multipath group, so it is skipped by the alt-count check below (the if let Some(alts) guard). The C2 faithful reconstruction (crate::to_miniscript::to_miniscript_descriptor_multipath) handles the None-override by emitting a single-path XPub for that key while sibling keys stay MultiXPub. Only two multipath groups with DIFFERENT alt-counts are rejected.