KomodoPlatform / zebra

An ongoing Rust implementation of a Komodo node. 🦓
Apache License 2.0
3 stars 5 forks source link

fix getpeerinfo rpc to show only live peers, refactor getpeerinfo rpc to add more stat data #48

Open dimxy opened 1 year ago

dimxy commented 1 year ago

Fix: now getpeerinfo shows all peers in the address book, ever added. It show show only active peers (I believe, it was supposed to show only those that were 'recently live', see the statuses)

Refactor: Currently we made only basic getpeerinfo version which obtains its data only from the MetaAddr structure (with some connection statuses). The getpeerinfo version in komodod shows much more info. The idea is to add a PeerStat structure that has MetaAddr and is also subscribed to network requests and responses and obtains additional data from them, like: remote version and subversion, bytes sent/received, blocks and headers synced and in flight etc.

Also, let's use the single PeerStat object for both inbound/outbound peers (not the AddressBook and InboundConns as it is now)