From 108d1565c7fb981ed6b98616e1c347318f2148e8 Mon Sep 17 00:00:00 2001 From: Lazy Nina Date: Tue, 31 Dec 2024 00:41:58 -0500 Subject: [PATCH] try working with scope of variables --- routes/exchange.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routes/exchange.go b/routes/exchange.go index f18cfacc..d5b2f6cc 100644 --- a/routes/exchange.go +++ b/routes/exchange.go @@ -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