fix: wait available peer packet panic (#561)

Signed-off-by: Jim Ma <majinjing3@gmail.com>
This commit is contained in:
Jim Ma 2021-08-18 20:41:14 +08:00 committed by Gaius
parent 6cda73b8e9
commit 09d2cca7f7
No known key found for this signature in database
GPG Key ID: 8B4E5D1290FA2FFB
1 changed files with 2 additions and 1 deletions

View File

@ -415,11 +415,12 @@ loop:
}) })
if err != nil { if err != nil {
pt.Warnf("get piece task error: %s, wait available peers from scheduler", err) pt.Warnf("get piece task error: %s, wait available peers from scheduler", err.Error())
pt.span.RecordError(err) pt.span.RecordError(err)
if num, ok = pt.waitAvailablePeerPacket(); !ok { if num, ok = pt.waitAvailablePeerPacket(); !ok {
break loop break loop
} }
continue loop
} }
if !initialized { if !initialized {