From 4114edaa267a72f2b3eba31b351ca69acc31514e Mon Sep 17 00:00:00 2001
From: capossele <angelocapossele@gmail.com>
Date: Wed, 18 Dec 2019 16:33:44 +0000
Subject: [PATCH] :art: fixes getTransaction error handling

---
 plugins/gossip/gossip.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/plugins/gossip/gossip.go b/plugins/gossip/gossip.go
index 4691f4e5..12045c63 100644
--- a/plugins/gossip/gossip.go
+++ b/plugins/gossip/gossip.go
@@ -48,7 +48,10 @@ var (
 func getTransaction(h []byte) ([]byte, error) {
 	log.Info("Retrieving tx:", string(h))
 	tx, err := tangle.GetTransaction(string(h))
-	if err != nil || tx == nil {
+	if err != nil {
+		return []byte{}, err
+	}
+	if tx == nil {
 		return []byte{}, errors.New("Not found")
 	}
 	pTx := &pb.TransactionRequest{
-- 
GitLab