From 8e3ca101f06c616004e134610707a21342e01446 Mon Sep 17 00:00:00 2001 From: Dimitrios Siganos Date: Tue, 15 Mar 2022 23:18:30 +0000 Subject: [PATCH] Adding some comments to confirmation height store --- nano/secure/common.hpp | 5 +++++ nano/secure/store.hpp | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/nano/secure/common.hpp b/nano/secure/common.hpp index 852db4384a..cb1914b2aa 100644 --- a/nano/secure/common.hpp +++ b/nano/secure/common.hpp @@ -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{}; }; diff --git a/nano/secure/store.hpp b/nano/secure/store.hpp index ac724c0422..1eded7f227 100644 --- a/nano/secure/store.hpp +++ b/nano/secure/store.hpp @@ -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;