Skip to content

Commit 1496164

Browse files
authored
Merge pull request #722 from evoskuil/master
Remove obsolete workaround for lack of std::views::reverse.
2 parents 86051be + 6912c83 commit 1496164

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

include/bitcoin/node/impl/chasers/chaser_organize.ipp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#define LIBBITCOIN_NODE_CHASERS_CHASER_ORGANIZE_IPP
2121

2222
#include <algorithm>
23+
#include <ranges>
2324
#include <bitcoin/database.hpp>
2425
#include <bitcoin/network.hpp>
2526
#include <bitcoin/node/chasers/chaser.hpp>
@@ -260,7 +261,7 @@ void CLASS::do_organize(typename Block::cptr block,
260261
notify(error::success, chase::regressed, branch_point);
261262

262263
// Push stored strong headers to candidate chain.
263-
for (const auto& link: views_reverse(store_branch))
264+
for (const auto& link: std::views::reverse(store_branch))
264265
{
265266
if ((is_under_milestone(index) && !query.set_strong(link)) ||
266267
!query.push_candidate(link))
@@ -274,7 +275,7 @@ void CLASS::do_organize(typename Block::cptr block,
274275
}
275276

276277
// Store strong tree headers and push to candidate chain.
277-
for (const auto& key: views_reverse(tree_branch))
278+
for (const auto& key: std::views::reverse(tree_branch))
278279
{
279280
if ((ec = push_block(key)))
280281
{

src/chasers/chaser_confirm.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <bitcoin/node/chasers/chaser_confirm.hpp>
2020

2121
#include <functional>
22+
#include <ranges>
2223
#include <utility>
2324
#include <bitcoin/database.hpp>
2425
#include <bitcoin/network.hpp>
@@ -561,7 +562,7 @@ bool chaser_confirm::roll_back(const header_links& popped, size_t fork_point,
561562
if (!set_reorganized(query.to_confirmed(height), height))
562563
return false;
563564

564-
for (const auto& fk: views_reverse(popped))
565+
for (const auto& fk: std::views::reverse(popped))
565566
if (!reset_organized(fk, ++fork_point))
566567
return false;
567568

0 commit comments

Comments
 (0)