Skip to content

Refresh Bitcoin Core RPC client on authentication failure#4452

Open
RobertClarke wants to merge 1 commit into
ordinals:masterfrom
RobertClarke:refresh-bitcoin-rpc-on-auth-failure
Open

Refresh Bitcoin Core RPC client on authentication failure#4452
RobertClarke wants to merge 1 commit into
ordinals:masterfrom
RobertClarke:refresh-bitcoin-rpc-on-auth-failure

Conversation

@RobertClarke

@RobertClarke RobertClarke commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

When Bitcoin Core restarts, it regenerates the .cookie file with new credentials. Previously, ord would fail with 401 errors until restarted.

This is particularly useful when running ord server long-term while occasionally restarting Bitcoin Core for configuration changes (peer adjustments, network tuning, etc.). With this change, ord automatically recovers without manual intervention.

Changes:

  • Wrap Index.client in RwLock to allow runtime credential refresh
  • Add with_retry() wrapper that detects 401 errors and re-reads the cookie file
  • Apply retry logic to all Bitcoin Core RPC calls
  • Add similar retry logic to the async Fetcher used during indexing

@raphjaph raphjaph added this to Tracker Jan 20, 2026
@raphjaph raphjaph moved this to Ready for Review in Tracker Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

2 participants