You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(allow-block-list): add getters and return results (#5572)
## Description
Small changes to improve usability of the `allow-block-list` Behaviour.
When trying to use it, we found ourselves wanting to known:
- which were the current allowed or blocked peers: hence the new methods
`allowed_peers` and `blocked_peers`
- if the peer was already present in the set when adding or removing it
from the set: that is why `allow/disallow_peer` and `block/unblock_peer`
methods now return a boolean, allowing the end user the know if there
was a change or not (in our case, we needed it in order to log
something).
## Notes & open questions
<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->
## Change checklist
<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->
- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates
0 commit comments