BitSharp.Core.Domain.TxLookupKey.TxLookupKey C# (CSharp) Method

TxLookupKey() public method

Initializes a new instance of TxLookupKey with the specified block hash and transaction index.
public TxLookupKey ( UInt256 blockHash, int txIndex ) : BitSharp.Common
blockHash UInt256 The hash of the block containing the transaction.
txIndex int The index of the transaction within its block.
return BitSharp.Common
        public TxLookupKey(UInt256 blockHash, int txIndex)
        {
            BlockHash = blockHash;
            TxIndex = txIndex;

            var hashBytes = new byte[36];
            blockHash.ToByteArray(hashBytes);
            Bits.EncodeInt32(txIndex, hashBytes, 32);
            hashCode = Bits.ToInt32(new xxHash(32).ComputeHash(hashBytes));
        }