Skip to content
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

feat: show the banned reason if a peer was banned in the contacts #4525

Merged

Conversation

SWvheerden
Copy link
Collaborator

Description

Currently, if a peer has been banned, the constants will only show the peer is offline.
This PR queries the peer manager for the peer to ask if the peer was banned or not. When asking the contact service in the wallet for the online status of the contact, the service will now report if the peer was banned, as well the reason for the banning.

if let Some(time) = last_seen {
match self.connectivity.get_peer_info(contact.node_id.clone()).await? {
Some(peer_data) => {
if peer_data.banned_until().is_some() {
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
if peer_data.banned_until().is_some() {
if peer_data.is_banned() {

@stringhandler stringhandler merged commit f970f81 into tari-project:development Aug 24, 2022
stringhandler pushed a commit that referenced this pull request Aug 25, 2022
#4536)

Description
---
updates get_online_status call in js api

Motivation and Context
---
get_online_status returns a string ptr. #4525 

How Has This Been Tested?
---
Cucumber tests
@SWvheerden SWvheerden deleted the sw_show_banned_in_contacts branch August 31, 2022 06:17
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.

None yet

3 participants