|
|
@ -1,5 +1,7 @@
|
|
|
|
#pragma once
|
|
|
|
#pragma once
|
|
|
|
#include <llarp/router_contact.hpp>
|
|
|
|
#include <llarp/router_contact.hpp>
|
|
|
|
|
|
|
|
#include <llarp/util/time.hpp>
|
|
|
|
|
|
|
|
#include <optional>
|
|
|
|
|
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -15,7 +17,7 @@ namespace llarp
|
|
|
|
virtual bool
|
|
|
|
virtual bool
|
|
|
|
GossipRC(const RouterContact& rc) = 0;
|
|
|
|
GossipRC(const RouterContact& rc) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
using Time_t = std::chrono::milliseconds;
|
|
|
|
using Time_t = Duration_t;
|
|
|
|
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
virtual void
|
|
|
|
Decay(Time_t now) = 0;
|
|
|
|
Decay(Time_t now) = 0;
|
|
|
@ -31,5 +33,13 @@ namespace llarp
|
|
|
|
/// forget the replay filter entry given pubkey
|
|
|
|
/// forget the replay filter entry given pubkey
|
|
|
|
virtual void
|
|
|
|
virtual void
|
|
|
|
Forget(const RouterID& router) = 0;
|
|
|
|
Forget(const RouterID& router) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// returns the time point when we will send our next gossip at
|
|
|
|
|
|
|
|
virtual TimePoint_t
|
|
|
|
|
|
|
|
NextGossipAt() const = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// returns the time point when we sent our last gossip at or nullopt if we never did
|
|
|
|
|
|
|
|
virtual std::optional<TimePoint_t>
|
|
|
|
|
|
|
|
LastGossipAt() const = 0;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} // namespace llarp
|
|
|
|
} // namespace llarp
|
|
|
|