Skip to content

fix(xdc): prevent InvalidOperationException in XdcPool.EndRound#10416

Closed
andrewshab3 wants to merge 1 commit intoNethermindEth:masterfrom
andrewshab3:prevent-InvalidOperationException
Closed

fix(xdc): prevent InvalidOperationException in XdcPool.EndRound#10416
andrewshab3 wants to merge 1 commit intoNethermindEth:masterfrom
andrewshab3:prevent-InvalidOperationException

Conversation

@andrewshab3
Copy link
Copy Markdown
Contributor

Changes

The original code iterated over _items.Keys while calling _items.Remove() inside the loop.This causes InvalidOperationException: Collection was modified; enumeration operation may not execute at runtime when any item matches the removal condition.

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

@andrewshab3
Copy link
Copy Markdown
Contributor Author

andrewshab3 commented Feb 13, 2026

@LukaszRozmej @ak88 sorry, can you check please?

@cicr99
Copy link
Copy Markdown
Contributor

cicr99 commented Feb 18, 2026

Hi @andrewshab3, current version supports Dictionary.Remove during enumeration without throwing (see here in docs).
You can take a look at this conversation for more context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants