BitSharper.Transaction.HashTransactionForSignature C# (CSharp) Метод

HashTransactionForSignature() приватный Метод

private HashTransactionForSignature ( SigHash type, bool anyoneCanPay ) : byte[]
type SigHash
anyoneCanPay bool
Результат byte[]
        private byte[] HashTransactionForSignature(SigHash type, bool anyoneCanPay)
        {
            using (var bos = new MemoryStream())
            {
                BitcoinSerializeToStream(bos);
                // We also have to write a hash type.
                var hashType = (uint) type + 1;
                if (anyoneCanPay)
                    hashType |= 0x80;
                Utils.Uint32ToByteStreamLe(hashType, bos);
                // Note that this is NOT reversed to ensure it will be signed correctly. If it were to be printed out
                // however then we would expect that it is IS reversed.
                return Utils.DoubleDigest(bos.ToArray());
            }
        }