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
2 changes: 1 addition & 1 deletion include/bitcoin/database/impl/query/merkle.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ hash_digest CLASS::get_merkle_root(size_t height) const NOEXCEPT

// static/protected
TEMPLATE
CLASS::positions CLASS::merkle_branch(size_t leaf, size_t leaves,
positions CLASS::merkle_branch(size_t leaf, size_t leaves,
bool compress) NOEXCEPT
{
using namespace system;
Expand Down
2 changes: 0 additions & 2 deletions include/bitcoin/database/query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,6 @@ class query

/// merkle
/// -----------------------------------------------------------------------
struct position { size_t sibling; size_t width; };
using positions = std::vector<position>;

// merkle related utilities
static hash_digest partial_subroot(hashes&& tree, size_t span) NOEXCEPT;
Expand Down
3 changes: 3 additions & 0 deletions include/bitcoin/database/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ using counts = std::pair<size_t, size_t>;
using sizes = std::pair<size_t, size_t>;
using heights = std_vector<size_t>;

struct position { size_t sibling; size_t width; };
using positions = std::vector<position>;

struct header_state { header_link link; code ec; };
using header_states = std::vector<header_state>;

Expand Down
3 changes: 1 addition & 2 deletions test/query/merkle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class merkle_accessor
{
public:
using base = test::query_accessor;
using positions = base::positions;
using base::base;
using base::merkle_branch;
using base::interval_span;
Expand Down Expand Up @@ -113,7 +112,7 @@ BOOST_AUTO_TEST_CASE(query_merkle___merkle_branch__seven__six_four_and_zero)

BOOST_AUTO_TEST_CASE(block__merkle_branch__medium_power_of_two__expected)
{
const merkle_accessor::positions expected{ { 14, 1 }, { 6, 2 }, { 2, 4 }, { 0, 8 } };
const positions expected{ { 14, 1 }, { 6, 2 }, { 2, 4 }, { 0, 8 } };

auto branch = merkle_accessor::merkle_branch(15, 16, true);
BOOST_REQUIRE_EQUAL(branch.size(), 4u);
Expand Down