Fix lastSend tracking
This commit is contained in:
parent
d24fca67b8
commit
9b3b7d2237
1 changed files with 2 additions and 1 deletions
3
peer.go
3
peer.go
|
@ -77,7 +77,7 @@ func (p *peer) handle(ctx context.Context) error {
|
|||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
if rstate == receiverStateUnconnected {
|
||||
if sstate == senderStateUnconnected {
|
||||
return ctx.Err()
|
||||
}
|
||||
// Send a best-effort Router Down before returning
|
||||
|
@ -100,6 +100,7 @@ func (p *peer) handle(ctx context.Context) error {
|
|||
|
||||
// Send another Open-Req
|
||||
sendRetries++
|
||||
lastSend = time.Now()
|
||||
if _, err := p.send(p.tr.NewOpenReqPacket(nil)); err != nil {
|
||||
log.Printf("Couldn't send Open-Req packet: %v", err)
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue