Ejemplo n.º 1
0
        public bool Equals(CfdDescriptorScriptData other)
        {
            if (ScriptType != other.ScriptType)
            {
                return(false);
            }
            switch (ScriptType)
            {
            case CfdDescriptorScriptType.Taproot:
                return(KeyData.Equals(other.KeyData) && ScriptTree.Equals(other.ScriptTree));

            case CfdDescriptorScriptType.Pk:
            case CfdDescriptorScriptType.Pkh:
            case CfdDescriptorScriptType.Wpkh:
            case CfdDescriptorScriptType.Combo:
                return(KeyData.Equals(other.KeyData));

            case CfdDescriptorScriptType.Sh:
            case CfdDescriptorScriptType.Wsh:
            case CfdDescriptorScriptType.Multi:
            case CfdDescriptorScriptType.SortedMulti:
            case CfdDescriptorScriptType.Raw:
                return(RedeemScript.Equals(other.RedeemScript));

            case CfdDescriptorScriptType.Addr:
                return(Address.Equals(other.Address));

            default:
                return(false);
            }
        }