Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ test_libbitcoin_database_test_SOURCES = \
test/query/properties_block.cpp \
test/query/properties_tx.cpp \
test/query/sequences.cpp \
test/query/signatures.cpp \
test/query/sizes.cpp \
test/query/address/address_balance.cpp \
test/query/address/address_history.cpp \
Expand Down Expand Up @@ -134,7 +135,9 @@ test_libbitcoin_database_test_SOURCES = \
test/tables/archives/transaction.cpp \
test/tables/archives/txs.cpp \
test/tables/caches/duplicate.cpp \
test/tables/caches/ecdsa.cpp \
test/tables/caches/prevout.cpp \
test/tables/caches/schnorr.cpp \
test/tables/caches/validated_bk.cpp \
test/tables/caches/validated_tx.cpp \
test/tables/indexes/height.cpp \
Expand Down Expand Up @@ -217,6 +220,7 @@ include_bitcoin_database_impl_query_HEADERS = \
include/bitcoin/database/impl/query/properties_tx.ipp \
include/bitcoin/database/impl/query/query.ipp \
include/bitcoin/database/impl/query/sequences.ipp \
include/bitcoin/database/impl/query/signatures.ipp \
include/bitcoin/database/impl/query/sizes.ipp

include_bitcoin_database_impl_query_addressdir = ${includedir}/bitcoin/database/impl/query/address
Expand Down Expand Up @@ -316,7 +320,9 @@ include_bitcoin_database_tables_archives_HEADERS = \
include_bitcoin_database_tables_cachesdir = ${includedir}/bitcoin/database/tables/caches
include_bitcoin_database_tables_caches_HEADERS = \
include/bitcoin/database/tables/caches/duplicate.hpp \
include/bitcoin/database/tables/caches/ecdsa.hpp \
include/bitcoin/database/tables/caches/prevout.hpp \
include/bitcoin/database/tables/caches/schnorr.hpp \
include/bitcoin/database/tables/caches/validated_bk.hpp \
include/bitcoin/database/tables/caches/validated_tx.hpp

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
<ClCompile Include="..\..\..\..\test\query\properties_block.cpp" />
<ClCompile Include="..\..\..\..\test\query\properties_tx.cpp" />
<ClCompile Include="..\..\..\..\test\query\sequences.cpp" />
<ClCompile Include="..\..\..\..\test\query\signatures.cpp" />
<ClCompile Include="..\..\..\..\test\query\sizes.cpp" />
<ClCompile Include="..\..\..\..\test\settings.cpp" />
<ClCompile Include="..\..\..\..\test\store.cpp" />
Expand All @@ -196,7 +197,9 @@
<ClCompile Include="..\..\..\..\test\tables\archives\transaction.cpp" />
<ClCompile Include="..\..\..\..\test\tables\archives\txs.cpp" />
<ClCompile Include="..\..\..\..\test\tables\caches\duplicate.cpp" />
<ClCompile Include="..\..\..\..\test\tables\caches\ecdsa.cpp" />
<ClCompile Include="..\..\..\..\test\tables\caches\prevout.cpp" />
<ClCompile Include="..\..\..\..\test\tables\caches\schnorr.cpp" />
<ClCompile Include="..\..\..\..\test\tables\caches\validated_bk.cpp" />
<ClCompile Include="..\..\..\..\test\tables\caches\validated_tx.cpp" />
<ClCompile Include="..\..\..\..\test\tables\indexes\height.cpp">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@
<ClCompile Include="..\..\..\..\test\query\sequences.cpp">
<Filter>src\query</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\query\signatures.cpp">
<Filter>src\query</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\query\sizes.cpp">
<Filter>src\query</Filter>
</ClCompile>
Expand Down Expand Up @@ -264,9 +267,15 @@
<ClCompile Include="..\..\..\..\test\tables\caches\duplicate.cpp">
<Filter>src\tables\caches</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\tables\caches\ecdsa.cpp">
<Filter>src\tables\caches</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\tables\caches\prevout.cpp">
<Filter>src\tables\caches</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\tables\caches\schnorr.cpp">
<Filter>src\tables\caches</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\tables\caches\validated_bk.cpp">
<Filter>src\tables\caches</Filter>
</ClCompile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\association.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\associations.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\duplicate.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\ecdsa.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\prevout.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\schnorr.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\validated_bk.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\validated_tx.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\context.hpp" />
Expand Down Expand Up @@ -260,6 +262,7 @@
<None Include="..\..\..\..\include\bitcoin\database\impl\query\properties_tx.ipp" />
<None Include="..\..\..\..\include\bitcoin\database\impl\query\query.ipp" />
<None Include="..\..\..\..\include\bitcoin\database\impl\query\sequences.ipp" />
<None Include="..\..\..\..\include\bitcoin\database\impl\query\signatures.ipp" />
<None Include="..\..\..\..\include\bitcoin\database\impl\query\sizes.ipp" />
<None Include="..\..\..\..\include\bitcoin\database\impl\store.ipp" />
<None Include="packages.config" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,15 @@
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\duplicate.hpp">
<Filter>include\bitcoin\database\tables\caches</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\ecdsa.hpp">
<Filter>include\bitcoin\database\tables\caches</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\prevout.hpp">
<Filter>include\bitcoin\database\tables\caches</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\schnorr.hpp">
<Filter>include\bitcoin\database\tables\caches</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\validated_bk.hpp">
<Filter>include\bitcoin\database\tables\caches</Filter>
</ClInclude>
Expand Down Expand Up @@ -487,6 +493,9 @@
<None Include="..\..\..\..\include\bitcoin\database\impl\query\sequences.ipp">
<Filter>include\bitcoin\database\impl\query</Filter>
</None>
<None Include="..\..\..\..\include\bitcoin\database\impl\query\signatures.ipp">
<Filter>include\bitcoin\database\impl\query</Filter>
</None>
<None Include="..\..\..\..\include\bitcoin\database\impl\query\sizes.ipp">
<Filter>include\bitcoin\database\impl\query</Filter>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
<ClCompile Include="..\..\..\..\test\query\properties_block.cpp" />
<ClCompile Include="..\..\..\..\test\query\properties_tx.cpp" />
<ClCompile Include="..\..\..\..\test\query\sequences.cpp" />
<ClCompile Include="..\..\..\..\test\query\signatures.cpp" />
<ClCompile Include="..\..\..\..\test\query\sizes.cpp" />
<ClCompile Include="..\..\..\..\test\settings.cpp" />
<ClCompile Include="..\..\..\..\test\store.cpp" />
Expand All @@ -196,7 +197,9 @@
<ClCompile Include="..\..\..\..\test\tables\archives\transaction.cpp" />
<ClCompile Include="..\..\..\..\test\tables\archives\txs.cpp" />
<ClCompile Include="..\..\..\..\test\tables\caches\duplicate.cpp" />
<ClCompile Include="..\..\..\..\test\tables\caches\ecdsa.cpp" />
<ClCompile Include="..\..\..\..\test\tables\caches\prevout.cpp" />
<ClCompile Include="..\..\..\..\test\tables\caches\schnorr.cpp" />
<ClCompile Include="..\..\..\..\test\tables\caches\validated_bk.cpp" />
<ClCompile Include="..\..\..\..\test\tables\caches\validated_tx.cpp" />
<ClCompile Include="..\..\..\..\test\tables\indexes\height.cpp">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@
<ClCompile Include="..\..\..\..\test\query\sequences.cpp">
<Filter>src\query</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\query\signatures.cpp">
<Filter>src\query</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\query\sizes.cpp">
<Filter>src\query</Filter>
</ClCompile>
Expand Down Expand Up @@ -264,9 +267,15 @@
<ClCompile Include="..\..\..\..\test\tables\caches\duplicate.cpp">
<Filter>src\tables\caches</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\tables\caches\ecdsa.cpp">
<Filter>src\tables\caches</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\tables\caches\prevout.cpp">
<Filter>src\tables\caches</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\tables\caches\schnorr.cpp">
<Filter>src\tables\caches</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\tables\caches\validated_bk.cpp">
<Filter>src\tables\caches</Filter>
</ClCompile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\association.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\associations.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\duplicate.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\ecdsa.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\prevout.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\schnorr.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\validated_bk.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\validated_tx.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\context.hpp" />
Expand Down Expand Up @@ -260,6 +262,7 @@
<None Include="..\..\..\..\include\bitcoin\database\impl\query\properties_tx.ipp" />
<None Include="..\..\..\..\include\bitcoin\database\impl\query\query.ipp" />
<None Include="..\..\..\..\include\bitcoin\database\impl\query\sequences.ipp" />
<None Include="..\..\..\..\include\bitcoin\database\impl\query\signatures.ipp" />
<None Include="..\..\..\..\include\bitcoin\database\impl\query\sizes.ipp" />
<None Include="..\..\..\..\include\bitcoin\database\impl\store.ipp" />
<None Include="packages.config" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,15 @@
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\duplicate.hpp">
<Filter>include\bitcoin\database\tables\caches</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\ecdsa.hpp">
<Filter>include\bitcoin\database\tables\caches</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\prevout.hpp">
<Filter>include\bitcoin\database\tables\caches</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\schnorr.hpp">
<Filter>include\bitcoin\database\tables\caches</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\caches\validated_bk.hpp">
<Filter>include\bitcoin\database\tables\caches</Filter>
</ClInclude>
Expand Down Expand Up @@ -487,6 +493,9 @@
<None Include="..\..\..\..\include\bitcoin\database\impl\query\sequences.ipp">
<Filter>include\bitcoin\database\impl\query</Filter>
</None>
<None Include="..\..\..\..\include\bitcoin\database\impl\query\signatures.ipp">
<Filter>include\bitcoin\database\impl\query</Filter>
</None>
<None Include="..\..\..\..\include\bitcoin\database\impl\query\sizes.ipp">
<Filter>include\bitcoin\database\impl\query</Filter>
</None>
Expand Down
2 changes: 2 additions & 0 deletions include/bitcoin/database.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@
#include <bitcoin/database/tables/archives/transaction.hpp>
#include <bitcoin/database/tables/archives/txs.hpp>
#include <bitcoin/database/tables/caches/duplicate.hpp>
#include <bitcoin/database/tables/caches/ecdsa.hpp>
#include <bitcoin/database/tables/caches/prevout.hpp>
#include <bitcoin/database/tables/caches/schnorr.hpp>
#include <bitcoin/database/tables/caches/validated_bk.hpp>
#include <bitcoin/database/tables/caches/validated_tx.hpp>
#include <bitcoin/database/tables/indexes/height.hpp>
Expand Down
8 changes: 8 additions & 0 deletions include/bitcoin/database/impl/query/extent.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ size_t CLASS::store_body_size() const NOEXCEPT
+ candidate_body_size()
+ confirmed_body_size()
+ strong_tx_body_size()
+ ecdsa_body_size()
+ schnorr_body_size()
+ duplicate_body_size()
+ prevout_body_size()
+ validated_bk_body_size()
Expand Down Expand Up @@ -120,6 +122,8 @@ size_t CLASS::store_head_size() const NOEXCEPT
+ candidate_head_size()
+ confirmed_head_size()
+ strong_tx_head_size()
+ ecdsa_head_size()
+ schnorr_head_size()
+ duplicate_head_size()
+ prevout_head_size()
+ validated_bk_head_size()
Expand All @@ -144,6 +148,8 @@ DEFINE_SIZES(tx)
DEFINE_SIZES(candidate)
DEFINE_SIZES(confirmed)
DEFINE_SIZES(strong_tx)
DEFINE_SIZES(ecdsa)
DEFINE_SIZES(schnorr)
DEFINE_SIZES(duplicate)
DEFINE_SIZES(prevout)
DEFINE_SIZES(validated_bk)
Expand Down Expand Up @@ -181,6 +187,8 @@ DEFINE_RECORDS(tx)
DEFINE_RECORDS(candidate)
DEFINE_RECORDS(confirmed)
DEFINE_RECORDS(strong_tx)
DEFINE_RECORDS(ecdsa)
DEFINE_RECORDS(schnorr)
DEFINE_RECORDS(duplicate)
DEFINE_RECORDS(filter_bk)
DEFINE_RECORDS(address)
Expand Down
68 changes: 68 additions & 0 deletions include/bitcoin/database/impl/query/signatures.ipp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/**
* Copyright (c) 2011-2026 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_DATABASE_QUERY_SIGNATURES_IPP
#define LIBBITCOIN_DATABASE_QUERY_SIGNATURES_IPP

#include <bitcoin/database/define.hpp>

namespace libbitcoin {
namespace database {

TEMPLATE
bool CLASS::set_signature(const hash_digest& digest, const ec_compressed& point,
const ec_signature& signature, const header_link& link) NOEXCEPT
{
// ========================================================================
const auto scope = store_.get_transactor();

// Clean single allocation failure (e.g. disk full).
return store_.ecdsa.put(table::ecdsa::record
{
{},
digest,
point,
signature,
link
});
// ========================================================================
}

TEMPLATE
bool CLASS::set_signature(const hash_digest& digest, const ec_xonly& point,
const ec_signature& signature, const header_link& link) NOEXCEPT
{
// ========================================================================
const auto scope = store_.get_transactor();

// Clean single allocation failure (e.g. disk full).
return store_.schnorr.put(table::schnorr::record
{
{},
digest,
point,
signature,
link
});
// ========================================================================
}

} // namespace database
} // namespace libbitcoin

#endif
Loading
Loading