From 84fe57433164fb7a5a3ea46ab4ad7106b6090683 Mon Sep 17 00:00:00 2001 From: Tim Williams Date: Tue, 12 Jun 2018 14:11:40 -0400 Subject: [PATCH] refactor broadcasttx function --- blockExplorerApi/handler.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/blockExplorerApi/handler.go b/blockExplorerApi/handler.go index 58256351c2..496941db7b 100644 --- a/blockExplorerApi/handler.go +++ b/blockExplorerApi/handler.go @@ -273,12 +273,10 @@ func BroadcastTx(w http.ResponseWriter, r *http.Request) { } tx_hash := dat["result"] if(tx_hash == nil) { - errObj := dat["error"] - errObj2 := errObj.(map[string]interface{}) - fmt.Println() + errMap := dat["error"].(map[string]interface{}) w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) - fmt.Fprintln(w, "ERROR:", errObj2["message"]) + fmt.Fprintln(w, "ERROR:", errMap["message"]) } else { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK)