mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 19:30:44 +00:00
strategyUpdateRequest returns message type
This commit is contained in:
parent
0da3b36175
commit
e6e6964e5a
1 changed files with 7 additions and 6 deletions
13
bzz/hive.go
13
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue