Exemple #1
0
        public override int GetHashCode()
        {
            switch (ScriptType)
            {
            case CfdDescriptorScriptType.Taproot:
                return(ScriptType.GetHashCode() + KeyData.GetHashCode() + ScriptTree.GetHashCode());

            case CfdDescriptorScriptType.Pk:
            case CfdDescriptorScriptType.Pkh:
            case CfdDescriptorScriptType.Wpkh:
            case CfdDescriptorScriptType.Combo:
                return(ScriptType.GetHashCode() + KeyData.GetHashCode());

            case CfdDescriptorScriptType.Sh:
            case CfdDescriptorScriptType.Wsh:
            case CfdDescriptorScriptType.Multi:
            case CfdDescriptorScriptType.SortedMulti:
            case CfdDescriptorScriptType.Raw:
                return(ScriptType.GetHashCode() + RedeemScript.GetHashCode());

            case CfdDescriptorScriptType.Addr:
                return(ScriptType.GetHashCode() + Address.GetHashCode());

            default:
                return(ScriptType.GetHashCode());
            }
        }
Exemple #2
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hash = 17;

                hash = hash * 23 + ScriptType.GetHashCode();
                hash = hash * 23 + Type.GetHashCode();

                return(hash);
            }
        }
Exemple #3
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hash = 17;

                hash = hash * 23 + ScriptType.GetHashCode();
                hash = hash * 23 + Type.GetHashCode();

                if (ScriptInstances != null)
                {
                    hash = hash * 23 + ScriptInstances.GetHashCode();
                }

                if (RegistrationParams != default(IScriptRegistrationParams))
                {
                    hash = hash * 23 + RegistrationParams.GetHashCode();
                }
                return(hash);
            }
        }