Ejemplo n.º 1
0
 public override HashVersion GetHashVersion(Network network)
 {
     if (Redeem == null)
     {
         return(base.GetHashVersion(network));
     }
     else
     {
         return(ScriptCoin.Create(network, this, Redeem).GetHashVersion(network));
     }
 }
Ejemplo n.º 2
0
 public override Script GetScriptCode(Network network)
 {
     if (_OverrideScriptCode != null)
     {
         return(_OverrideScriptCode);
     }
     if (Redeem == null)
     {
         return(base.GetScriptCode(network));
     }
     else
     {
         return(ScriptCoin.Create(network, this, Redeem).GetScriptCode(network));
     }
 }
Ejemplo n.º 3
0
        public ScriptCoin TryToScriptCoin(Script redeemScript)
        {
            if (redeemScript == null)
            {
                throw new ArgumentNullException(nameof(redeemScript));
            }
            var scriptCoin = this as ScriptCoin;

            if (scriptCoin != null)
            {
                return(scriptCoin);
            }
            if (!ScriptCoin.IsCoherent(TxOut.ScriptPubKey, redeemScript, out var error))
            {
                return(null);
            }
            return(new ScriptCoin(this, redeemScript));
        }
Ejemplo n.º 4
0
        //public static RPCResponse SendCommandNoThrows(this RPCClient client, string commandName, params object[] parameters)
        //{
        //	return client.SendCommand(new RPCRequest
        //	{
        //		Method = commandName,
        //		Params = parameters
        //	}, throwIfRPCError: false);
        //}

        //public static Task<RPCResponse> SendCommandNoThrowsAsync(this RPCClient client, string commandName, params object[] parameters)
        //{
        //	return client.SendCommandAsync(new RPCRequest
        //	{
        //		Method = commandName,
        //		Params = parameters
        //	}, throwIfRPCError: false);
        //}

        public static ScriptCoin Clone(this ScriptCoin scriptCoin)
        {
            return(new ScriptCoin(scriptCoin, scriptCoin.Redeem));
        }