Skip to content

Commit

Permalink
Expose store snapshot to query interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed May 11, 2024
1 parent ceab5c4 commit 60d009b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/bitcoin/database/impl/query/query.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ code CLASS::get_code() const NOEXCEPT
return is_full() ? error::disk_full : store_.get_fault();
}

TEMPLATE
code CLASS::snapshot(
const typename Store::event_handler& handler) const NOEXCEPT
{
return store_.snapshot(handler);
}

} // namespace database
} // namespace libbitcoin

Expand Down
6 changes: 6 additions & 0 deletions include/bitcoin/database/query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ class query

query(Store& value) NOEXCEPT;

/// Store management from query-holder (not store owner) context.
/// -----------------------------------------------------------------------

/// True if disk is full and no other store error condition.
bool is_full() const NOEXCEPT;

Expand All @@ -91,6 +94,9 @@ class query
/// Get priority condition, error::disk_full if is_full, else first code.
code get_code() const NOEXCEPT;

/// Snapshot the store while running.
code snapshot(const typename Store::event_handler& handler) const NOEXCEPT;

/// Initialization (natural-keyed).
/// -----------------------------------------------------------------------
/// Not reliable during organization.
Expand Down

0 comments on commit 60d009b

Please sign in to comment.