Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FEATURE] Implement stopatheight#2534

Open
allocz wants to merge 1 commit into
btcsuite:masterfrom
allocz:stopatheight
Open

[FEATURE] Implement stopatheight#2534
allocz wants to merge 1 commit into
btcsuite:masterfrom
allocz:stopatheight

Conversation

@allocz
Copy link
Copy Markdown

@allocz allocz commented May 20, 2026

Change Description

When the flag stopatheight is set to something greater than zero, btcd stops immediately after processing the height provided.

Also, we won't let the node start if the current height is equal or greater than the provided stopatheight.

This is a very useful feature for testing purposes.

Steps to Test

To test that the node is stopping at the expected height, execute btcd with the flag --stopatheight=N, the node should stop after processing the block N, it can be verified by starting the node with --connect=127.0.0.1:invalid_port and without the --stopatheight flag, the log will show that the chainstate is at height N.

Pull Request Checklist

Testing

  • Your PR passes all CI checks.
  • Tests covering the positive and negative (error paths) are included.
  • Bug fixes contain tests triggering the bug to prevent regressions.

Code Style and Documentation

📝 Please see our Contribution Guidelines for further guidance.

When the flag stopatheight is set to something greater than zero,
btcd stops immediately after processing the height provided.

Also, we won't let the node start if the current height is equal
or greater than the provided stopatheight.
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