Skip to content

Commit

Permalink
Fix panic in DRR scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer committed May 17, 2024
1 parent 4cce1bd commit d0192f3
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions pkg/protocol/engine/congestioncontrol/scheduler/drr/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,17 +595,19 @@ func (s *Scheduler) selectIssuer(slot iotago.SlotIndex) (Deficit, *IssuerQueue)

func (s *Scheduler) removeIssuer(issuerID iotago.AccountID, err error) {
q := s.basicBuffer.IssuerQueue(issuerID)
q.nonReadyMap.ForEach(func(_ iotago.BlockID, block *blocks.Block) bool {
block.SetDropped()
s.events.BlockDropped.Trigger(block, err)
if q != nil {
q.nonReadyMap.ForEach(func(_ iotago.BlockID, block *blocks.Block) bool {
block.SetDropped()
s.events.BlockDropped.Trigger(block, err)

return true
})
return true
})

for i := range q.readyHeap.Len() {
block := q.readyHeap[i].Value
block.SetDropped()
s.events.BlockDropped.Trigger(block, err)
for i := range q.readyHeap.Len() {
block := q.readyHeap[i].Value
block.SetDropped()
s.events.BlockDropped.Trigger(block, err)
}
}

s.deficits.Delete(issuerID)
Expand Down

0 comments on commit d0192f3

Please sign in to comment.