コード例 #1
0
ファイル: Transaction.cs プロジェクト: KursLabIgor/bitprim-cs
        /// <summary>
        /// Raw transaction data.
        /// </summary>
        /// <param name="wire">Iif true, include data size at the beginning.</param>
        /// <returns>Byte array with transaction data.</returns>
        public byte[] ToData(bool wire)
        {
            int txSize = 0;
            var txData = new NativeBuffer(TransactionNative.chain_transaction_to_data(nativeInstance_, wire? 1:0, ref txSize));

            return(txData.CopyToManagedArray(txSize));
        }
コード例 #2
0
ファイル: Script.cs プロジェクト: KursLabIgor/bitprim-cs
        /// <summary>
        /// Raw script data
        /// </summary>
        /// <param name="prefix"> Tells whether to include script size in data </param>
        /// <returns> Byte array with script data </returns>
        public byte[] ToData(bool prefix)
        {
            int scriptSize = 0;
            var scriptData = new NativeBuffer(ScriptNative.chain_script_to_data(nativeInstance_, prefix? 1:0, ref scriptSize));

            return(scriptData.CopyToManagedArray(scriptSize));
        }
コード例 #3
0
ファイル: Block.cs プロジェクト: KursLabIgor/bitprim-cs
        /// <summary>
        /// Raw block data.
        /// </summary>
        /// <param name="wire">if and only if true, include data size at the beginning.</param>
        /// <returns>Byte array with block data.</returns>
        public byte[] ToData(bool wire)
        {
            int blockSize = 0;
            var blockData = new NativeBuffer(BlockNative.chain_block_to_data(nativeInstance_, wire? 1:0, ref blockSize));

            return(blockData.CopyToManagedArray(blockSize));
        }