mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-16 18:37:51 +01:00
UDT: Fix bug in NativeCongestionControl.OnNAK that causes a crash when the provided losslist is empty
This commit is contained in:
@@ -160,7 +160,7 @@ func (ncc NativeCongestionControl) OnNAK(parms CongestionControlParms, losslist
|
||||
c. Record the current largest sent sequence number (LastDecSeq).
|
||||
*/
|
||||
pktSendPeriod := parms.GetPacketSendPeriod()
|
||||
if ncc.lastDecSeq.BlindDiff(losslist[0]) > 0 {
|
||||
if len(losslist) > 0 && ncc.lastDecSeq.BlindDiff(losslist[0]) > 0 {
|
||||
ncc.lastDecPeriod = pktSendPeriod
|
||||
parms.SetPacketSendPeriod(pktSendPeriod * 1125 / 1000)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user