File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,12 @@ bool CLASS::is_full() const NOEXCEPT
9898 return to_bool (get_space ()) && !is_fault ();
9999}
100100
101+ TEMPLATE
102+ bool CLASS::is_coalesced () const NOEXCEPT
103+ {
104+ return get_fork () == get_top_candidate ();
105+ }
106+
101107TEMPLATE
102108size_t CLASS::get_space () const NOEXCEPT
103109{
@@ -110,6 +116,12 @@ code CLASS::reload(const typename Store::event_handler& handler) const NOEXCEPT
110116 return store_.reload (handler);
111117}
112118
119+ TEMPLATE
120+ code CLASS::prune (const typename Store::event_handler& handler) const NOEXCEPT
121+ {
122+ return store_.prune (handler);
123+ }
124+
113125TEMPLATE
114126code CLASS::snapshot (const typename Store::event_handler& handler) const NOEXCEPT
115127{
Original file line number Diff line number Diff line change @@ -456,8 +456,7 @@ code CLASS::prune(const event_handler& handler) NOEXCEPT
456456 };
457457
458458 // Prevouts resettable if all candidates confirmed (fork is candidate top).
459- const query<CLASS> query_{ *this };
460- if (query_.get_fork () == query_.get_top_candidate ())
459+ if (query<CLASS>{ *this }.is_coalesced ())
461460 {
462461 // zeroize table head, set body logical size to zero.
463462 prune (ec, prevout, table_t ::prevout_table);
Original file line number Diff line number Diff line change @@ -98,12 +98,18 @@ class query
9898 // / True if there is a disk full condition.
9999 bool is_full () const NOEXCEPT;
100100
101+ // / True if candidate top is fork point header.
102+ bool is_coalesced () const NOEXCEPT;
103+
101104 // / Get the space required to clear the disk full condition.
102105 size_t get_space () const NOEXCEPT;
103106
104107 // / Resume from disk full condition.
105108 code reload (const typename Store::event_handler& handler) const NOEXCEPT;
106109
110+ // / Prune the store while running.
111+ code prune (const typename Store::event_handler& handler) const NOEXCEPT;
112+
107113 // / Snapshot the store while running.
108114 code snapshot (const typename Store::event_handler& handler) const NOEXCEPT;
109115
You can’t perform that action at this time.
0 commit comments