New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rpc] Add peer / channel stats to getinfo RPC #2087

Merged
merged 3 commits into from Nov 21, 2018

Conversation

Projects
None yet
3 participants
@conscott
Copy link
Collaborator

conscott commented Nov 15, 2018

This change adds the following fields to the getinfo RPC

  • num_peers: Total number of connected peers
  • num_pending_channels: Number of channels (awaiting min conf)
  • num_active_channels: Number of active channels (confirmed funds and not yet closed)
  • num_inactive_chanenls: Number of inactive channels (closed)

This effectively matches what exists in the lnd version of getinfo

Commit breakdown

  • 5826e9a: simply moves the implementation to peer_control.c since it needs those structures to get peer stats
  • 7b1d892 actually adds the peer / channel stats
  • 41c29f9 updates the mock tests

This is my first significant PR to the repo, so I'll gladly take any feedback / harsh criticism. First time dusting off the C handbook in a while :)

@cdecker cdecker requested a review from rustyrussell Nov 15, 2018

@rustyrussell
Copy link
Contributor

rustyrussell left a comment

Minor style nits only; peer_control isn't really the place for getinfo, but it works for now, and I prefer '++' as more idomatic than '+= 1'.

ACK 41c29f9

@conscott conscott force-pushed the conscott:add_to_getinfo branch from 41c29f9 to 1bfe266 Nov 20, 2018

conscott added some commits Nov 15, 2018

@cdecker cdecker force-pushed the conscott:add_to_getinfo branch from 1bfe266 to d099f58 Nov 20, 2018

@cdecker

This comment has been minimized.

Copy link
Member

cdecker commented Nov 20, 2018

Rebased to address conflict. Reapplying @rustyrussell's ACK

ACK 531496c

@rustyrussell rustyrussell merged commit 795bc1b into ElementsProject:master Nov 21, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@rustyrussell

This comment has been minimized.

Copy link
Contributor

rustyrussell commented Nov 21, 2018

Thanks!

1 similar comment
@conscott

This comment has been minimized.

Copy link
Collaborator

conscott commented Nov 21, 2018

Thanks!

@conscott conscott deleted the conscott:add_to_getinfo branch Jan 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment