Skip to content

Conversation

@shargon
Copy link
Member

@shargon shargon commented Nov 24, 2025

Description

Required for neo-project/neo-node#920 #4333

This pull request introduces a new method to the MemoryPool class in MemoryPool.cs that allows for the removal of a transaction by its hash in a thread-safe manner. This addition improves the ability to manage transactions within the memory pool by providing a way to safely remove and clean up associated data.

Transaction removal functionality:

  • Added a new TryRemove method to the MemoryPool class, which attempts to remove a transaction by its hash and returns the transaction if found. This method ensures thread safety using a write lock and also cleans up related data structures and verification context.

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Unit Testing
  • Run Application
  • Local Computer Tests
  • No Testing

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@shargon shargon marked this pull request as draft November 25, 2025 08:59
@shargon shargon mentioned this pull request Dec 3, 2025
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants