Skip to content

Conversation

@refined-element
Copy link

@refined-element refined-element commented Jan 28, 2026

Summary

This PR adds comprehensive documentation on common error codes that developers encounter when testing applications with Bitcoin Core, along with resolution suggestions for each error.

New Sections Added:

  1. Block Validation Errors (codes 16-68)

    • Includes the specific bad-fork-prior-to-checkpoint (code 67) error mentioned in the original request
    • Common transaction validation errors
  2. RPC Error Codes (-1 through -28)

    • Generic errors, type errors, invalid parameters
    • Verification errors and warmup states
  3. Wallet Error Codes

    • Keypool exhaustion
    • Encryption/unlock issues
    • Wallet not found errors
  4. Network Error Codes

    • Connection issues
    • Initial block download states
  5. Debugging Tips

    • How to check debug logs
    • Using printtoconsole
    • Resetting regtest state

Context

This PR addresses a bounty originally listed on bitcoin.org (issue #1837: "Add section with possible error codes and resolution suggestions"). Since the developer documentation was moved from bitcoin.org to developer.bitcoin.org, I'm submitting the PR here where the documentation now lives.

Original bounty: bitcoin-dot-org/Bitcoin.org#1837

The bounty specifically mentioned the error:

bitcoin-cli -regtest generate 11
"CreateNewBlock: TestBlockValidity failed: bad-fork-prior-to-checkpoint (code 67)"

This error and its resolution are now documented in the Block Validation Errors section.

Payment Address

Bitcoin address for bounty payment: bc1qax8d6etvphms3tqqc7hy52vas4af7ezv4msvqd


🤖 Generated with Claude Code

Add comprehensive section on common error codes and troubleshooting:

- Block validation errors (codes 16-68) including the specific
  bad-fork-prior-to-checkpoint (code 67) error
- RPC error codes (-1 through -28) with explanations
- Wallet-specific error codes
- Network error codes
- Debugging tips for developers

This helps developers quickly identify and resolve common issues
when testing applications with Bitcoin Core.

Addresses bitcoin-dot-org/Bitcoin.org#1837

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 28, 2026 21:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive error code documentation to the testing examples, helping developers understand and resolve common errors when testing applications with Bitcoin Core. The documentation addresses a specific bounty request from the bitcoin.org repository.

Changes:

  • Added "Common Error Codes" section to testing.rst with four categories of errors (Block Validation, RPC, Wallet, and Network)
  • Included specific error code 67 (bad-fork-prior-to-checkpoint) that was mentioned in the original bounty
  • Added debugging tips section with practical troubleshooting guidance

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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