OpenCBDC Transaction Processor
|
Service to answer client requests for processing status updates on submitted transactions. More...
#include <watchtower.hpp>
Public Member Functions | |
watchtower ()=delete | |
watchtower (size_t block_cache_size, size_t error_cache_size) | |
Constructor. | |
void | add_block (cbdc::atomizer::block &&blk) |
Adds a new block from the Atomizer to the Watchtower. | |
void | add_errors (std::vector< tx_error > &&errs) |
Adds an error from an internal component to the Watchtower's error cache. | |
auto | handle_status_update_request (const status_update_request &req) -> std::unique_ptr< response > |
Composes a response to a status update request based on the data available. | |
auto | handle_best_block_height_request (const best_block_height_request &req) -> std::unique_ptr< response > |
Composes a response to a status update best block height request. | |
Service to answer client requests for processing status updates on submitted transactions.
Definition at line 127 of file watchtower.hpp.
|
delete |
cbdc::watchtower::watchtower::watchtower | ( | size_t | block_cache_size, |
size_t | error_cache_size ) |
Constructor.
block_cache_size | the number of blocks to store in this Watchtower's block cache. |
error_cache_size | the number of errors to store in this Watchtower's error cache. |
Definition at line 161 of file watchtower.cpp.
void cbdc::watchtower::watchtower::add_block | ( | cbdc::atomizer::block && | blk | ) |
Adds a new block from the Atomizer to the Watchtower.
Currently just forwards the block to the in-memory cache to await requests from clients.
blk | block to add. |
Definition at line 15 of file watchtower.cpp.
References cbdc::watchtower::block_cache::push_block().
void cbdc::watchtower::watchtower::add_errors | ( | std::vector< tx_error > && | errs | ) |
Adds an error from an internal component to the Watchtower's error cache.
errs | error to add. |
Definition at line 20 of file watchtower.cpp.
References cbdc::watchtower::block_cache::check_spent(), cbdc::watchtower::block_cache::check_unspent(), cbdc::watchtower::error_cache::push_errors(), cbdc::watchtower::spent, and cbdc::watchtower::unspent.
auto cbdc::watchtower::watchtower::handle_best_block_height_request | ( | const best_block_height_request & | req | ) | -> std::unique_ptr<response> |
Composes a response to a status update best block height request.
req | a best block height request from a client. |
Definition at line 153 of file watchtower.cpp.
auto cbdc::watchtower::watchtower::handle_status_update_request | ( | const status_update_request & | req | ) | -> std::unique_ptr<response> |
Composes a response to a status update request based on the data available.
Currently only supports check requests against blocks cached in-memory.
Error responses:
req | a status update request from a client. |
Definition at line 120 of file watchtower.cpp.