Skip to content

Commit ec56467

Browse files
authored
Merge pull request #933 from evoskuil/master
Simplify chaser_validate::do_bump() by using new db method.
2 parents 15ad640 + 64f6439 commit ec56467

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/chasers/chaser_validate.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -132,24 +132,9 @@ void chaser_validate::do_checked(height_t height) NOEXCEPT
132132
void chaser_validate::do_bump(height_t) NOEXCEPT
133133
{
134134
BC_ASSERT(stranded());
135-
const auto& query = archive();
136-
137-
// TODO: make store query?
138135

139-
// Only necessary when bumping as next position may not be associated.
140136
const auto height = add1(position());
141-
const auto link = query.to_candidate(height);
142-
const auto ec = query.get_block_state(link);
143-
144-
// First block state should be unvalidated, valid, or confirmable. This is
145-
// assured in do_checked by chasing block checks. unknown_state is a reset.
146-
const auto ready =
147-
(ec == database::error::unvalidated) ||
148-
(ec == database::error::block_valid) ||
149-
(ec == database::error::unknown_state) ||
150-
(ec == database::error::block_confirmable);
151-
152-
if (ready)
137+
if (archive().is_validateable(height))
153138
do_bumped(height);
154139
}
155140

0 commit comments

Comments
 (0)