From d9096abbce670483533779807f989763a61fb9c3 Mon Sep 17 00:00:00 2001 From: Lyndsay Roger Date: Wed, 19 Aug 2015 21:26:06 +1200 Subject: [PATCH] Bug fix on nil error --- crawler.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crawler.go b/crawler.go index d7a8154..12f4314 100644 --- a/crawler.go +++ b/crawler.go @@ -1,6 +1,7 @@ package main import ( + "errors" "log" "net" "strconv" @@ -170,7 +171,7 @@ func crawlIP(tw *Twistee) ([]*wire.NetAddress, *CrawlError) { log.Printf("%s - Remote version: %v\n", ip, msg.ProtocolVersion) } default: - return nil, &CrawlError{"Did not receive expected Version message from remote client", err} + return nil, &CrawlError{"Did not receive expected Version message from remote client", errors.New("")} } // FIXME - update twistee client version with what they just said @@ -195,7 +196,7 @@ func crawlIP(tw *Twistee) ([]*wire.NetAddress, *CrawlError) { log.Printf("%s - received Version Ack\n", ip) } default: - return nil, &CrawlError{"Did not receive expected Ver Ack message from remote client", err} + return nil, &CrawlError{"Did not receive expected Ver Ack message from remote client", errors.New("")} } // send getaddr command @@ -236,7 +237,7 @@ func crawlIP(tw *Twistee) ([]*wire.NetAddress, *CrawlError) { } // received too many messages before requested Addr - return nil, &CrawlError{"message loop - did not receive remote addresses in first 25 messages from remote client", err} + return nil, &CrawlError{"message loop - did not receive remote addresses in first 25 messages from remote client", errors.New("")} } /*