---
title: llarp::consensus::reachability_testing

---

# llarp::consensus::reachability_testing





## Public Functions

|                | Name           |
| -------------- | -------------- |
| std::optional< [RouterID](Classes/structllarp_1_1RouterID.md) > | **[next_random](Classes/classllarp_1_1consensus_1_1reachability__testing.md#function-next-random)**([AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * router, const time_point_t & now =clock_t::now(), bool requeue =true) |
| std::vector< std::pair< [RouterID](Classes/structllarp_1_1RouterID.md), int > > | **[get_failing](Classes/classllarp_1_1consensus_1_1reachability__testing.md#function-get-failing)**(const time_point_t & now =clock_t::now()) |
| void | **[add_failing_node](Classes/classllarp_1_1consensus_1_1reachability__testing.md#function-add-failing-node)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & pk, int previous_failures =0) |
| void | **[remove_node_from_failing](Classes/classllarp_1_1consensus_1_1reachability__testing.md#function-remove-node-from-failing)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & pk)<br>removes the public key from the failing set  |
| void | **[incoming_ping](Classes/classllarp_1_1consensus_1_1reachability__testing.md#function-incoming-ping)**(const time_point_t & now =clock_t::now()) |
| void | **[check_incoming_tests](Classes/classllarp_1_1consensus_1_1reachability__testing.md#function-check-incoming-tests)**(const time_point_t & now =clock_t::now()) |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| std::normal_distribution< float > | **[TESTING_INTERVAL](Classes/classllarp_1_1consensus_1_1reachability__testing.md#variable-testing-interval)**  |
| constexpr auto | **[TESTING_BACKOFF](Classes/classllarp_1_1consensus_1_1reachability__testing.md#variable-testing-backoff)**  |
| constexpr auto | **[TESTING_BACKOFF_MAX](Classes/classllarp_1_1consensus_1_1reachability__testing.md#variable-testing-backoff-max)**  |
| constexpr int | **[MAX_RETESTS_PER_TICK](Classes/classllarp_1_1consensus_1_1reachability__testing.md#variable-max-retests-per-tick)**  |
| constexpr auto | **[MAX_TIME_WITHOUT_PING](Classes/classllarp_1_1consensus_1_1reachability__testing.md#variable-max-time-without-ping)**  |
| constexpr auto | **[WHINING_INTERVAL](Classes/classllarp_1_1consensus_1_1reachability__testing.md#variable-whining-interval)**  |

## Public Functions Documentation

### function next_random

```cpp
std::optional< RouterID > next_random(
    AbstractRouter * router,
    const time_point_t & now =clock_t::now(),
    bool requeue =true
)
```


### function get_failing

```cpp
std::vector< std::pair< RouterID, int > > get_failing(
    const time_point_t & now =clock_t::now()
)
```


### function add_failing_node

```cpp
void add_failing_node(
    const RouterID & pk,
    int previous_failures =0
)
```


### function remove_node_from_failing

```cpp
void remove_node_from_failing(
    const RouterID & pk
)
```

removes the public key from the failing set 

### function incoming_ping

```cpp
void incoming_ping(
    const time_point_t & now =clock_t::now()
)
```


### function check_incoming_tests

```cpp
void check_incoming_tests(
    const time_point_t & now =clock_t::now()
)
```


## Public Attributes Documentation

### variable TESTING_INTERVAL

```cpp
std::normal_distribution< float > TESTING_INTERVAL {10.0, 3.0};
```


### variable TESTING_BACKOFF

```cpp
static constexpr auto TESTING_BACKOFF = 10s;
```


### variable TESTING_BACKOFF_MAX

```cpp
static constexpr auto TESTING_BACKOFF_MAX = 2min;
```


### variable MAX_RETESTS_PER_TICK

```cpp
static constexpr int MAX_RETESTS_PER_TICK = 4;
```


### variable MAX_TIME_WITHOUT_PING

```cpp
static constexpr auto MAX_TIME_WITHOUT_PING = 2min;
```


### variable WHINING_INTERVAL

```cpp
static constexpr auto WHINING_INTERVAL = 2min;
```


-------------------------------

Updated on 2023-01-20 at 18:12:18 +0000