Return error when loading not existing block in ETH #176

This commit is contained in:
Martin Boehm 2019-05-23 16:05:33 +02:00
parent 749e534a26
commit 8cd94070ce

View File

@ -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 {