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
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ code CLASS::get_prevouts(point_sets& sets, size_t points,
return system::error::confirmed_double_spend;

// Augment spend.points with metadata.
auto it = cache.spends.begin();
auto it = cache.spends.cbegin();
for (auto& set: sets)
{
for (auto& point: set.points)
Expand Down
8 changes: 4 additions & 4 deletions include/bitcoin/database/impl/unspent/unspent_scanner.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ code CLASS::scan(difference_set& set, unspent_totals& out,
index.push_back(at);

const auto parallel = poolstl::execution::par_if(turbo_);
std::for_each(parallel, index.begin(), index.end(),
std::for_each(parallel, index.cbegin(), index.cend(),
[&](size_t at) NOEXCEPT
{
if (fail)
Expand Down Expand Up @@ -94,7 +94,7 @@ code CLASS::bounds(std_vector<size_t>& out,
std::iota(blocks.begin(), blocks.end(), zero);
const auto parallel = poolstl::execution::par_if(turbo_);

std::for_each(parallel, blocks.begin(), blocks.end(),
std::for_each(parallel, blocks.cbegin(), blocks.cend(),
[&](size_t block) NOEXCEPT
{
counts.at(block) = query_.get_tx_count(branch.at(block));
Expand Down Expand Up @@ -222,10 +222,10 @@ code CLASS::toggle_creates(difference_set& set, output_links& exclusions,
if (!store_.outs.puts.get(ptr, tx.outs_fk, outs))
return error::integrity;

auto excluded = outs.excluded.begin();
auto excluded = outs.excluded.cbegin();
for (uint32_t index{}; index < outs.number; ++index)
{
if (excluded != outs.excluded.end() && excluded->first == index)
if (excluded != outs.excluded.cend() && excluded->first == index)
exclusions.push_back((excluded++)->second);
else
set.toggle(tx.outs_fk + index);
Expand Down
8 changes: 4 additions & 4 deletions include/bitcoin/database/impl/unspent/unspent_serial.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ code CLASS::partition(unspent_elements& out, sizes& offsets,
const auto parallel = poolstl::execution::par_if(turbo_);
std::atomic_bool fail{};

std::for_each(parallel, index.begin(), index.end(),
std::for_each(parallel, index.cbegin(), index.cend(),
[&](size_t chunk) NOEXCEPT
{
if (fail)
Expand All @@ -139,7 +139,7 @@ code CLASS::partition(unspent_elements& out, sizes& offsets,
starts(counts, offsets, chunks);
out.resize(offsets.back());

std::for_each(parallel, index.begin(), index.end(),
std::for_each(parallel, index.cbegin(), index.cend(),
[&](size_t chunk) NOEXCEPT
{
if (fail)
Expand Down Expand Up @@ -261,7 +261,7 @@ code CLASS::fill(unspent_coins& out, output_links& puts,
std::iota(index.begin(), index.end(), zero);
std::atomic_bool fail{};

std::for_each(parallel, index.begin(), index.end(),
std::for_each(parallel, index.cbegin(), index.cend(),
[&](size_t chunk) NOEXCEPT
{
if (fail)
Expand Down Expand Up @@ -310,7 +310,7 @@ void CLASS::gather(unspent_coins& out, output_links& links,
std::iota(index.begin(), index.end(), zero);
const auto parallel = poolstl::execution::par_if(turbo_);

std::for_each(parallel, index.begin(), index.end(),
std::for_each(parallel, index.cbegin(), index.cend(),
[&](size_t at) NOEXCEPT
{
out.at(at) = std::move(coins.at(order.at(at)));
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/database/impl/unspent/unspent_spans.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ code CLASS::for_each(const difference_set& set, const Span& span) const NOEXCEPT
std::atomic_bool fail{};
const auto parallel = poolstl::execution::par_if(turbo_);

std::for_each(parallel, index.begin(), index.end(),
std::for_each(parallel, index.cbegin(), index.cend(),
[&](size_t chunk) NOEXCEPT
{
if (fail)
Expand Down
14 changes: 7 additions & 7 deletions test/query/address/address_outpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE(query_address__get_confirmed_unspent_outpoints__turbo_genes
const std::atomic_bool cancel{};
BOOST_REQUIRE(!query.get_confirmed_unspent_outpoints(cancel, out, test::genesis_address0, true));
BOOST_REQUIRE_EQUAL(out.size(), 1u);
BOOST_REQUIRE(*out.begin() == query.get_outpoint(query.to_output(0, 0)));
BOOST_REQUIRE(*out.cbegin() == query.get_outpoint(query.to_output(0, 0)));
}

BOOST_AUTO_TEST_CASE(query_address__get_confirmed_unspent_outpoints__genesis__expected)
Expand All @@ -53,7 +53,7 @@ BOOST_AUTO_TEST_CASE(query_address__get_confirmed_unspent_outpoints__genesis__ex
const std::atomic_bool cancel{};
BOOST_REQUIRE(!query.get_confirmed_unspent_outpoints(cancel, out, test::genesis_address0));
BOOST_REQUIRE_EQUAL(out.size(), 1u);
BOOST_REQUIRE(*out.begin() == query.get_outpoint(query.to_output(0, 0)));
BOOST_REQUIRE(*out.cbegin() == query.get_outpoint(query.to_output(0, 0)));
}

// get_minimum_unspent_outpoints
Expand Down Expand Up @@ -101,7 +101,7 @@ BOOST_AUTO_TEST_CASE(query_address__get_minimum_unspent_outpoints__at__included)
const std::atomic_bool cancel{};
BOOST_REQUIRE(!query.get_minimum_unspent_outpoints(cancel, out, test::genesis_address0, 5000000000));
BOOST_REQUIRE_EQUAL(out.size(), 1u);
BOOST_REQUIRE(*out.begin() == query.get_outpoint(query.to_output(0, 0)));
BOOST_REQUIRE(*out.cbegin() == query.get_outpoint(query.to_output(0, 0)));
}

BOOST_AUTO_TEST_CASE(query_address__get_minimum_unspent_outpoints__below__included)
Expand All @@ -117,11 +117,11 @@ BOOST_AUTO_TEST_CASE(query_address__get_minimum_unspent_outpoints__below__includ
const std::atomic_bool cancel{};
BOOST_REQUIRE(!query.get_minimum_unspent_outpoints(cancel, out, test::genesis_address0, 0));
BOOST_REQUIRE_EQUAL(out.size(), 1u);
BOOST_REQUIRE(*out.begin() == query.get_outpoint(query.to_output(0, 0)));
BOOST_REQUIRE(*out.cbegin() == query.get_outpoint(query.to_output(0, 0)));

BOOST_REQUIRE(!query.get_minimum_unspent_outpoints(cancel, out, test::genesis_address0, 4999999999));
BOOST_REQUIRE_EQUAL(out.size(), 1u);
BOOST_REQUIRE(*out.begin() == query.get_outpoint(query.to_output(0, 0)));
BOOST_REQUIRE(*out.cbegin() == query.get_outpoint(query.to_output(0, 0)));
}

// get_address_outpoints1
Expand All @@ -139,7 +139,7 @@ BOOST_AUTO_TEST_CASE(query_address__get_address_outpoints1__turbo_genesis__expec
const std::atomic_bool cancel{};
BOOST_REQUIRE(!query.get_address_outpoints(cancel, out, test::genesis_address0, true));
BOOST_REQUIRE_EQUAL(out.size(), 1u);
BOOST_REQUIRE(*out.begin() == query.get_outpoint(query.to_output(0, 0)));
BOOST_REQUIRE(*out.cbegin() == query.get_outpoint(query.to_output(0, 0)));
}

BOOST_AUTO_TEST_CASE(query_address__get_address_outpoints1__genesis__expected)
Expand All @@ -155,7 +155,7 @@ BOOST_AUTO_TEST_CASE(query_address__get_address_outpoints1__genesis__expected)
const std::atomic_bool cancel{};
BOOST_REQUIRE(!query.get_address_outpoints(cancel, out, test::genesis_address0));
BOOST_REQUIRE_EQUAL(out.size(), 1u);
BOOST_REQUIRE(*out.begin() == query.get_outpoint(query.to_output(0, 0)));
BOOST_REQUIRE(*out.cbegin() == query.get_outpoint(query.to_output(0, 0)));
}

BOOST_AUTO_TEST_CASE(query_address__get_address_outpoints1__cancel__query_canceled_false)
Expand Down
Loading