Skip to content

Commit

Permalink
Merge pull request #975 from iotaledger/fix/panic-in-drr-scheduler
Browse files Browse the repository at this point in the history
Fix panic in DRR scheduler
  • Loading branch information
muXxer authored May 20, 2024
2 parents 4cce1bd + d0192f3 commit be93026
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 be93026

Please sign in to comment.