Skip to content

Commit

Permalink
Adding some comments to confirmation height store
Browse files Browse the repository at this point in the history
  • Loading branch information
dsiganos committed Mar 15, 2022
1 parent 6a425b6 commit 8e3ca10
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nano/secure/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,14 @@ class confirmation_height_info final
public:
confirmation_height_info () = default;
confirmation_height_info (uint64_t, nano::block_hash const &);

void serialize (nano::stream &) const;
bool deserialize (nano::stream &);

/** height of the cemented frontier */
uint64_t height{};

/** hash of the highest cemented block, the cemented/confirmed frontier */
nano::block_hash frontier{};
};

Expand Down
7 changes: 7 additions & 0 deletions nano/secure/store.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,14 @@ class confirmation_height_store
{
public:
virtual void put (nano::write_transaction const & transaction_a, nano::account const & account_a, nano::confirmation_height_info const & confirmation_height_info_a) = 0;

/** Retrieves confirmation height info relating to an account.
* The parameter confirmation_height_info_a is always written.
* On error, the confirmation height and frontier hash are set to 0.
* Ruturns true on error, false on success.
*/
virtual bool get (nano::transaction const & transaction_a, nano::account const & account_a, nano::confirmation_height_info & confirmation_height_info_a) = 0;

virtual bool exists (nano::transaction const & transaction_a, nano::account const & account_a) const = 0;
virtual void del (nano::write_transaction const & transaction_a, nano::account const & account_a) = 0;
virtual uint64_t count (nano::transaction const & transaction_a) = 0;
Expand Down

0 comments on commit 8e3ca10

Please sign in to comment.