Count failures as otherMessages

This commit is contained in:
Andrey Petrov 2014-05-19 15:19:45 -07:00
parent c498b62051
commit af0d810fac
2 changed files with 2 additions and 1 deletions

2
cmd.go
View File

@ -29,7 +29,7 @@ type Options struct {
Seed []string `short:"s" long:"seed" description:"Override which seeds to use." default-mask:"<bitcoin-core DNS seeds>"`
Concurrency int `short:"c" long:"concurrency" description:"Maximum number of concurrent connections to open." default:"10"`
ConnectTimeout time.Duration `short:"t" long:"connect-timeout" description:"Maximum time to wait to connect before giving up." default:"10s"`
UserAgent string `short:"A" long:"user-agent" description:"Client name to advertise while crawling. Should be in format of '/name:x.y.z/'." default:"/btc-crawl:0.1.1/"`
UserAgent string `short:"A" long:"user-agent" description:"Client name to advertise while crawling. Should be in format of '/name:x.y.z/'." default:"/btc-crawl:0.1.2/"`
PeerAge time.Duration `long:"peer-age" description:"Ignore discovered peers older than this." default:"24h"`
StopAfter int `long:"stop-after" description:"Stop crawling after this many results." default:"0"`
}

View File

@ -101,6 +101,7 @@ func (c *Crawler) handleAddress(address string) *Result {
// many unrelated messages.
msg, _, err := peer.ReadMessage()
if err != nil {
otherMessages = append(otherMessages, err.Error())
logger.Warningf("[%s] Failed to read message: %v", address, err)
continue
}