10#ifndef OPENCBDC_TX_SRC_WATCHTOWER_ERROR_CACHE_H_
11#define OPENCBDC_TX_SRC_WATCHTOWER_ERROR_CACHE_H_
19#include <shared_mutex>
20#include <unordered_map>
48 -> std::optional<tx_error>;
52 std::queue<std::shared_ptr<tx_error>> m_errs;
54 std::shared_ptr<tx_error>,
58 std::shared_ptr<tx_error>,
Stores a set of internal transaction errors in memory, indexed by Tx ID and UHS ID.
auto check_tx_id(const hash_t &tx_id) const -> std::optional< tx_error >
Checks the cache for an error associated with the given Tx ID.
void push_errors(std::vector< tx_error > &&errs)
Moves an error into the error cache, evicting the oldest error if the cache has reached its maximum s...
auto check_uhs_id(const hash_t &uhs_id) const -> std::optional< tx_error >
Checks the cache for an error associated with the given UHS ID.
std::array< unsigned char, cbdc::hash_size > hash_t
SHA256 hash container.
SipHash function to generate STL data structure hash keys for system IDs.
Messages atomizers and shards can use to transmit errors to the watchtower, and which the watchtower ...