public uint GetSigOpCount(Script scriptSig)
		{
			if(!IsPayToScriptHash)
				return GetSigOpCount(true);
			// This is a pay-to-script-hash scriptPubKey;
			// get the last item that the scriptSig
			// pushes onto the stack:
			var validSig = new PayToScriptHashTemplate().CheckScriptSig(scriptSig, this);
			return !validSig ? 0 : new Script(scriptSig.ToOps().Last().PushData).GetSigOpCount(true);
			// ... and return its opcount:
		}
Example #2
0
        public uint GetSigOpCount(Script scriptSig)
        {
            if (!IsPayToScriptHash)
            {
                return(GetSigOpCount(true));
            }
            // This is a pay-to-script-hash scriptPubKey;
            // get the last item that the scriptSig
            // pushes onto the stack:
            var validSig = new PayToScriptHashTemplate()
            {
                VerifyRedeemScript = false
            }.CheckScriptSig(scriptSig, null);

            if (!validSig)
            {
                return(0);
            }
            /// ... and return its opcount:
            return(new Script(scriptSig.ToOps().Last().PushData).GetSigOpCount(true));
        }
Example #3
0
		public uint GetSigOpCount(Script scriptSig)
		{
			if(!IsPayToScriptHash)
				return GetSigOpCount(true);
			// This is a pay-to-script-hash scriptPubKey;
			// get the last item that the scriptSig
			// pushes onto the stack:
			var validSig = new PayToScriptHashTemplate().CheckScriptSig(scriptSig, this);
			return !validSig ? 0 : new Script(scriptSig.ToOps().Last().PushData).GetSigOpCount(true);
			// ... and return its opcount:
		}
Example #4
0
 public void SetDestination(ScriptId scriptId)
 {
     ScriptPubKey = new PayToScriptHashTemplate().GenerateScriptPubKey(scriptId);
 }
Example #5
0
 public void SetDestination(ScriptId scriptId)
 {
     ScriptPubKey = new PayToScriptHashTemplate().GenerateScriptPubKey(scriptId);
 }
Example #6
0
        public BitcoinScriptAddress GetScriptAddress(Network network)
        {
            var redeem = new PayToScriptHashTemplate().GenerateScriptPubKey(new PayToPubkeyTemplate().GenerateScriptPubKey(this));

            return(new BitcoinScriptAddress(redeem.ID, network));
        }
Example #7
0
 public uint GetSigOpCount(Script scriptSig)
 {
     if(!IsPayToScriptHash)
         return GetSigOpCount(true);
     // This is a pay-to-script-hash scriptPubKey;
     // get the last item that the scriptSig
     // pushes onto the stack:
     var validSig = new PayToScriptHashTemplate()
     {
         VerifyRedeemScript = false
     }.CheckScriptSig(scriptSig, null);
     if(!validSig)
         return 0;
     /// ... and return its opcount:
     return new Script(scriptSig.ToOps().Last().PushData).GetSigOpCount(true);
 }