Uh oh!
There was an error while loading. Please reload this page.
Bitcoin peers - #27
Open
R27-pixel wants to merge 9 commits into
Open
Conversation
R27-pixel
marked this pull request as draft
June 16, 2026 03:06
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
R27-pixel
marked this pull request as ready for review
July 16, 2026 13:58
There was a problem hiding this comment.
Pull request overview
Adds Bitcoin Core RPC-backed chain/peer details to the Bitcoin Status UI, replacing placeholder panels with real content and wiring background polling into the app loop.
Changes:
- Introduces a new
BitcoinClientto query Bitcoin Core RPC for chain info, connection count, and peer addresses. - Wires Bitcoin chain info fetching/polling into
Appand the main render loop, and renders Chain Info + Peers tabs with loading/error/empty states. - Improves P2Pool share rendering by deduplicating live shares (and adds a regression test).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/snapshots/pdm__ui__tests__bitcoin_status_tab_peers_render.snap | Updates snapshot for the Peers tab to reflect new prompt/title rendering. |
| src/snapshots/pdm__ui__tests__bitcoin_status_screen_render.snap | Updates snapshot for Chain Info tab and includes assertion metadata change. |
| src/main.rs | Polls Bitcoin chain info results each UI loop iteration. |
| src/components/p2pool_status_view.rs | Deduplicates rendered live shares by blockhash and adds a test. |
| src/components/mod.rs | Exposes the new bitcoin_client module. |
| src/components/bitcoin_status_view.rs | Implements Chain Info/Peers rendering using App’s Bitcoin chain info state and adds unit tests (chain info only). |
| src/components/bitcoin_client.rs | New Bitcoin Core RPC client for chain info + peer address retrieval, with mock-server tests. |
| src/app.rs | Adds Bitcoin chain info state + async channel plumbing and triggers fetching when entering Bitcoin Status. |
Suppressed comments (1)
src/components/bitcoin_status_view.rs:123
- In the Peers tab, "Connected Peers" is derived from
connected_peer_addresses.len(), which can be lower than the real peer count becausegetpeerinfoentries may omit/emptyaddrvalues. SinceBitcoinChainInfoalready carriesconnection_count(fromgetconnectioncount), use that when available to avoid displaying an incorrect count.
} else if let Some(info) = &app.bitcoin_chain_info {
let mut lines = Vec::with_capacity(info.connected_peer_addresses.len() + 3);
lines.push(Line::from(format!(
"Connected Peers: {}",
info.connected_peer_addresses.len()
)));
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+112
to
+118
| fn render_peers(f: &mut Frame, app: &App, area: Rect) { | ||
| let text = if app.bitcoin_conf_path.is_none() { | ||
| vec![Line::from(Span::styled( | ||
| "Select a bitcoin.conf file to load Bitcoin Core peer info.", | ||
| Style::default().fg(Color::DarkGray), | ||
| ))] | ||
| } else if let Some(info) = &app.bitcoin_chain_info { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add peer information to the Bitcoin Status section.
Currently, peer information only includes the connected peer count and peer addresses.