mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-11 07:10:36 +00:00
7caa87862e
All #ifndef guards on headers have been removed, I think, in favor of #pragma once Headers are now included as `#include "filename"` if the included file resides in the same directory as the file including it, or any subdirectory therein. Otherwise they are included as `#include <project/top/dir/relative/path/filename>` The above does not include system/os headers.
29 lines
679 B
C++
29 lines
679 B
C++
#pragma once
|
|
#include <llarp/router_contact.hpp>
|
|
|
|
namespace llarp
|
|
{
|
|
struct I_RCGossiper
|
|
{
|
|
virtual ~I_RCGossiper() = default;
|
|
/// try goissping RC
|
|
/// return false if we hit a cooldown for this rc
|
|
/// return true if we gossiped this rc to at least 1 peer
|
|
virtual bool
|
|
GossipRC(const RouterContact& rc) = 0;
|
|
|
|
using Time_t = std::chrono::milliseconds;
|
|
|
|
virtual void
|
|
Decay(Time_t now) = 0;
|
|
|
|
/// return true if we should gossip our RC now
|
|
virtual bool
|
|
ShouldGossipOurRC(Time_t now) const = 0;
|
|
|
|
/// return true if that rc is owned by us
|
|
virtual bool
|
|
IsOurRC(const RouterContact& rc) const = 0;
|
|
};
|
|
} // namespace llarp
|