Ejemplo n.º 1
0
        public async Task <IActionResult> VerifyLastBlock([FromBody] CurrencyBlock block)
        {
            var result = await _node.CheckReceivedBlocksAsync(block);

            if (result == null)
            {
                return(Accepted(new
                {
                    Message = "Requesting blockchain to check."
                }));
            }

            if (result.Value)
            {
                return(Ok(block));
            }

            return(StatusCode((int)HttpStatusCode.Conflict, new
            {
                Message = "Blockchain is up to date."
            }));
        }