Kagome
Polkadot Runtime Engine in C++17
|
#include <reputation_repository_impl.hpp>
Public Member Functions | |
ReputationRepositoryImpl (std::shared_ptr< libp2p::basic::Scheduler > scheduler) | |
Reputation | reputation (const PeerId &peer_id) const override |
Current peer reputation. More... | |
Reputation | change (const PeerId &peer_id, ReputationChange diff) override |
Reputation | changeForATime (const PeerId &peer_id, ReputationChange diff, std::chrono::seconds duration) override |
Public Member Functions inherited from kagome::network::ReputationRepository | |
virtual | ~ReputationRepository ()=default |
Private Member Functions | |
void | tick () |
Private Attributes | |
std::shared_ptr< libp2p::basic::Scheduler > | scheduler_ |
std::unordered_map< PeerId, Reputation > | reputation_table_ |
libp2p::basic::Scheduler::Handle | tick_handler_ |
log::Logger | log_ |
Additional Inherited Members | |
Public Types inherited from kagome::network::ReputationRepository | |
using | PeerId = libp2p::peer::PeerId |
Definition at line 20 of file reputation_repository_impl.hpp.
kagome::network::ReputationRepositoryImpl::ReputationRepositoryImpl | ( | std::shared_ptr< libp2p::basic::Scheduler > | scheduler | ) |
Definition at line 16 of file reputation_repository_impl.cpp.
|
overridevirtual |
Change peer reputation by arbitrary amount of points
peer_id | - peer identifier |
diff | - reputation increment or decrement |
Implements kagome::network::ReputationRepository.
Definition at line 31 of file reputation_repository_impl.cpp.
|
overridevirtual |
Change peer reputation by arbitrary amount of points for a specified amount of time
peer_id | - peer identifier |
difff | - reputation increment or decrement |
duration | - amount of time to change peer reputation for |
Implements kagome::network::ReputationRepository.
Definition at line 44 of file reputation_repository_impl.cpp.
|
overridevirtual |
Current peer reputation.
Implements kagome::network::ReputationRepository.
Definition at line 25 of file reputation_repository_impl.cpp.
|
private |
Definition at line 83 of file reputation_repository_impl.cpp.
|
private |
Definition at line 43 of file reputation_repository_impl.hpp.
|
private |
Definition at line 39 of file reputation_repository_impl.hpp.
|
private |
Definition at line 38 of file reputation_repository_impl.hpp.
|
private |
Definition at line 41 of file reputation_repository_impl.hpp.