mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-20 19:56: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
|
- 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
|
! 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 {
|
switch rs.status {
|
||||||
case reqSearching:
|
case reqSearching:
|
||||||
self.addRequester(rs, req)
|
if self.addRequester(rs, req) {
|
||||||
timeout = self.searchTimeout(rs, req)
|
msgTyp = peersMsg
|
||||||
|
timeout = self.searchTimeout(rs, req)
|
||||||
|
}
|
||||||
case reqTimedOut:
|
case reqTimedOut:
|
||||||
|
msgTyp = peersMsg
|
||||||
case reqFound:
|
case reqFound:
|
||||||
if self.addRequester(rs, req) {
|
if self.addRequester(rs, req) {
|
||||||
send = true
|
msgTyp = storeRequestMsg
|
||||||
} else {
|
|
||||||
// timeout = time.Time(0)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue