Skip to content

Commit

Permalink
try working with scope of variables
Browse files Browse the repository at this point in the history
  • Loading branch information
lazynina committed Dec 31, 2024
1 parent dae0de1 commit 108d156
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion routes/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,9 @@ func (fes *APIServer) APIBlock(ww http.ResponseWriter, rr *http.Request) {
maxHeight))
return
}
blockNode, exists, err := fes.blockchain.GetBlockFromBestChainByHeight(uint64(blockRequest.Height), false)
var exists bool
var err error
blockNode, exists, err = fes.blockchain.GetBlockFromBestChainByHeight(uint64(blockRequest.Height), false)
if err != nil {
APIAddError(ww, fmt.Sprintf("APIBlockRequest: Problem fetching block: %v", err))
return
Expand Down

0 comments on commit 108d156

Please sign in to comment.