Exemplo n.º 1
0
        public override Script GetScriptCode(Network network)
        {
            if (!CanGetScriptCode(network))
            {
                throw new InvalidOperationException("You need to provide the P2WSH redeem script with ScriptCoin.ToScriptCoin()");
            }
            if (_OverrideScriptCode != null)
            {
                return(_OverrideScriptCode);
            }
            WitKeyId key = PayToWitPubKeyHashTemplate.Instance.ExtractScriptPubKeyParameters(network, Redeem);

            if (key != null)
            {
                return(key.AsKeyId().ScriptPubKey);
            }
            return(Redeem);
        }