From e6e6964e5ab612d34fe551481ee810a45c50e66b Mon Sep 17 00:00:00 2001 From: zelig Date: Thu, 5 Feb 2015 13:19:56 +0100 Subject: [PATCH] strategyUpdateRequest returns message type --- bzz/hive.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bzz/hive.go b/bzz/hive.go index cc82d603dc..be684f7b59 100644 --- a/bzz/hive.go +++ b/bzz/hive.go @@ -81,18 +81,19 @@ this is the most simplistic implementation: - respond with peers and timeout if still searching ! in the last case as well, we should respond with reject if already got requesterCount peers with that exact id */ -func (self *Hive) strategyUpdateRequest(rs *requestStatus, req *retrieveRequestMsgData) (send bool, timeout time.Time) { +func (self *Hive) strategyUpdateRequest(rs *requestStatus, req *retrieveRequestMsgData) (msgTyp int, timeout time.Time) { switch rs.status { case reqSearching: - self.addRequester(rs, req) - timeout = self.searchTimeout(rs, req) + if self.addRequester(rs, req) { + msgTyp = peersMsg + timeout = self.searchTimeout(rs, req) + } case reqTimedOut: + msgTyp = peersMsg case reqFound: if self.addRequester(rs, req) { - send = true - } else { - // timeout = time.Time(0) + msgTyp = storeRequestMsg } } return