OpenCBDC Transaction Processor
|
Stores a set of internal transaction errors in memory, indexed by Tx ID and UHS ID. More...
#include <error_cache.hpp>
Public Member Functions | |
error_cache ()=delete | |
error_cache (size_t k) | |
Constructor. | |
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 size. | |
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. | |
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. | |
Stores a set of internal transaction errors in memory, indexed by Tx ID and UHS ID.
Definition at line 26 of file error_cache.hpp.
|
delete |
|
explicit |
Constructor.
k | number of errors to store in memory. 0 -> no limit. |
Definition at line 11 of file error_cache.cpp.
auto cbdc::watchtower::error_cache::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.
tx_id | the Tx ID to check. |
Definition at line 65 of file error_cache.cpp.
auto cbdc::watchtower::error_cache::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.
uhs_id | the UHS ID to check. |
Definition at line 74 of file error_cache.cpp.
void cbdc::watchtower::error_cache::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 size.
errs | the error to move. |
Definition at line 16 of file error_cache.cpp.
Referenced by cbdc::watchtower::watchtower::add_errors().