コード例 #1
0
        /// <summary>
        /// Get the a whole block
        /// </summary>
        /// <param name="blockId"></param>
        /// <returns></returns>
        public async Task <Block> GetBlockAsync(uint256 blockId)
        {
            var resp = await SendCommandAsync("getblock", blockId.ToString(), false).ConfigureAwait(false);

            var rpcBlock = SatoshiBlockFormatter.Parse(resp.Result as JObject);

            return(SatoshiBlockFormatter.ToBlock(rpcBlock));
            //return new Block(Encoders.Hex.DecodeData(resp.Result.ToString()));
        }
コード例 #2
0
        /// <summary>
        /// Get the a whole block
        /// </summary>
        /// <param name="blockId"></param>
        /// <returns></returns>
        public async Task <RPCBlock> GetRPCBlock(uint256 blockId)
        {
            var resp = await SendCommandAsync("getblock", blockId.ToString(), false).ConfigureAwait(false);

            return(SatoshiBlockFormatter.Parse(resp.Result as JObject));
        }