Skip to content

Optimize pool refresh & prevent redundant block validation#139

Open
Rakni1988 wants to merge 1 commit intopdxwebdev:masterfrom
Rakni1988:dev
Open

Optimize pool refresh & prevent redundant block validation#139
Rakni1988 wants to merge 1 commit intopdxwebdev:masterfrom
Rakni1988:dev

Conversation

@Rakni1988
Copy link
Contributor

This update optimizes pool performance by preventing unnecessary block refreshes and duplicate block validation.

Fixes & Improvements:

  • Replaces is_synced() check with block source validation, ensuring refresh occurs only when necessary (newblock from peers or a mined block by the pool).
  • Prevents double-mining on an already found block, reducing wasted miner resources.
  • Avoids refresh deadlocks: Previously, synced or syncing states could occasionally block refreshes during normal operation, causing the pool to keep searching for an already found block.
  • Added is_verified flag to avoid redundant block validation:
    • Previously, test_block() ran twice in integrate_blocks_with_existing_chain().
    • Now, blocks marked verified won’t be re-validated before insertion.
    • Reduces unnecessary computational overhead and improves sync speed.

Result:

  • More accurate block updates
  • Better miner efficiency
  • No wasted hashing power
  • Faster chain synchronization due to reduced duplicate block checks.

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.

1 participant