From 73c49227a1db9034f63e72eacd68bad0ed205773 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Sun, 12 Jul 2026 00:25:36 -0400 Subject: [PATCH] Add set_prevalid(). --- .../bitcoin/database/impl/query/batch/prevalid.ipp | 14 ++++++++++++-- include/bitcoin/database/query.hpp | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/bitcoin/database/impl/query/batch/prevalid.ipp b/include/bitcoin/database/impl/query/batch/prevalid.ipp index 20683656a..f2c3097d2 100644 --- a/include/bitcoin/database/impl/query/batch/prevalid.ipp +++ b/include/bitcoin/database/impl/query/batch/prevalid.ipp @@ -54,6 +54,17 @@ bool CLASS::purge_prevalids() NOEXCEPT // ======================================================================== } +TEMPLATE +bool CLASS::set_prevalid(const header_link& link) NOEXCEPT +{ + // ======================================================================== + const auto scope = get_transactor(); + + // Clean single allocation failure (e.g. disk full). + return store_.prevalid.put(table::prevalid::record{ {}, link }); + // ======================================================================== +} + TEMPLATE bool CLASS::set_prevalids(const header_links& links) NOEXCEPT { @@ -61,8 +72,7 @@ bool CLASS::set_prevalids(const header_links& links) NOEXCEPT const auto scope = get_transactor(); // Clean single allocation failure (e.g. disk full). - const table::prevalid::put_refs prevalids{ {}, links }; - return store_.prevalid.put(prevalids); + return store_.prevalid.put(table::prevalid::put_refs{ {}, links }); // ======================================================================== } diff --git a/include/bitcoin/database/query.hpp b/include/bitcoin/database/query.hpp index a333aeb34..3295bda40 100644 --- a/include/bitcoin/database/query.hpp +++ b/include/bitcoin/database/query.hpp @@ -629,6 +629,7 @@ class query /// Cache all prevalids. header_links get_prevalids() const NOEXCEPT; + bool set_prevalid(const header_link& link) NOEXCEPT; bool set_prevalids(const header_links& links) NOEXCEPT; /// Confirmation.