#include "mst_storage.hpp"


Public Member Functions | |
| StateUpdateResult | apply (shared_model::interface::types::PublicKeyHexStringView target_peer_key, const MstState &new_state) |
| StateUpdateResult | updateOwnState (const DataType &tx) |
| MstState | extractExpiredTransactions (const TimeType ¤t_time) |
| MstState | getDiffState (shared_model::interface::types::PublicKeyHexStringView target_peer_key, const TimeType ¤t_time) |
| MstState | whatsNew (ConstRefState new_state) const |
| bool | batchInStorage (const DataType &batch) const |
| void | processFinalizedTransaction (shared_model::interface::types::HashType const &hash) |
| virtual | ~MstStorage ()=default |
Protected Member Functions | |
| MstStorage (logger::LoggerPtr log) | |
Protected Attributes | |
| logger::LoggerPtr | log_ |
MstStorage responsible for manage own and others MstStates. All methods of storage covered by mutex, because we assume that mutex possible to execute in concurrent environment.
|
virtualdefault |
|
explicitprotected |
Constructor provide initialization of protected fields, such as logger.
| StateUpdateResult iroha::MstStorage::apply | ( | shared_model::interface::types::PublicKeyHexStringView | target_peer_key, |
| const MstState & | new_state | ||
| ) |
Apply new state for peer
| target_peer_key | - key for for updating state |
| new_state | - state with new data |
| bool iroha::MstStorage::batchInStorage | ( | const DataType & | batch | ) | const |
Check, if passed batch is in the storage
| batch | to be checked |
Remove expired transactions and return them
| MstState iroha::MstStorage::getDiffState | ( | shared_model::interface::types::PublicKeyHexStringView | target_peer_key, |
| const TimeType & | current_time | ||
| ) |
Make state based on diff of own and target states. All expired transactions will be removed from diff.
| void iroha::MstStorage::processFinalizedTransaction | ( | shared_model::interface::types::HashType const & | hash | ) |
| StateUpdateResult iroha::MstStorage::updateOwnState | ( | const DataType & | tx | ) |
Provide updating state of current peer with new transaction
| tx | - new transaction for insertion in state |
| MstState iroha::MstStorage::whatsNew | ( | ConstRefState | new_state | ) | const |
Return diff between own and new state
| new_state | - state with new data |
|
protected |