Skip to content

Commit

Permalink
Return error when loading not existing block in ETH trezor#176
Browse files Browse the repository at this point in the history
  • Loading branch information
martinboehm committed May 27, 2019
1 parent 749e534 commit 8cd9407
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,9 @@ func (w *Worker) GetBlock(bid string, page int, txsOnPage int) (*Block, error) {
} else {
hash = bid
}
if hash == "" {
return nil, NewAPIError("Block not found", true)
}
bi, err := w.chain.GetBlockInfo(hash)
if err != nil {
if err == bchain.ErrBlockNotFound {
Expand Down

0 comments on commit 8cd9407

Please sign in to comment.