Example #1
0
        /// <summary>
        /// Extract P2SH or P2PH id from scriptSig
        /// </summary>
        /// <returns></returns>
        public TxDestination GetSigner()
        {
            var pubKey = _PayToPubkeyHash.ExtractScriptSigParameters(this);

            if (pubKey != null)
            {
                return(pubKey.PublicKey.ID);
            }
            var p2sh = _PayToScriptHash.ExtractScriptSigParameters(this);

            if (p2sh != null)
            {
                return(p2sh.RedeemScript.ID);
            }
            return(null);
        }