Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public IActionResult GetAddressIndexerTip()
[HttpGet]
[ProducesResponseType((int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.BadRequest)]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public IActionResult GetBlock([FromQuery] SearchByHashRequest query)
{
if (!this.ModelState.IsValid)
Expand All @@ -134,14 +135,14 @@ public IActionResult GetBlock([FromQuery] SearchByHashRequest query)
ChainedHeader chainedHeader = this.chainIndexer.GetHeader(blockId);

if (chainedHeader == null)
return this.Ok("Block not found");
return this.NotFound("Block not found");

Block block = chainedHeader.Block ?? this.blockStore.GetBlock(blockId);

// In rare occasions a block that is found in the
// indexer may not have been pushed to the store yet.
if (block == null)
return this.Ok("Block not found");
return this.NotFound("Block not found");

if (!query.OutputJson)
{
Expand Down