https://github.com/ElementsProject/elements/blob/f08447909101bfbbcaf89e382f55c87b2086198a/src/script/script.cpp#L216 Should tighten this up in case someone decides to get really cute with their wallet software and funds loss occurs.