Skip to content

Commit bbc08fa

Browse files
authored
Merge pull request #777 from evoskuil/master
In validator ensure prevouts set if block already validated.
2 parents 3176f9f + c3d13a3 commit bbc08fa

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/chasers/chaser_validate.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,21 +176,27 @@ void chaser_validate::do_bumped(height_t height) NOEXCEPT
176176
}
177177
else
178178
{
179-
complete_block(error::success, link, height, bypass);
179+
complete_block(error::success, link, height, true);
180180
}
181181
}
182182
else switch (ec.value())
183183
{
184+
case database::error::unvalidated:
185+
{
186+
post_block(link, bypass);
187+
break;
188+
}
184189
case database::error::block_valid:
185-
case database::error::block_confirmable:
186190
{
187-
// Previously valid is NOT considered bypass.
188-
complete_block(error::success, link, height, bypass);
191+
if (query.is_prevouts_cached(link))
192+
post_block(link, true);
193+
else
194+
complete_block(error::success, link, height, true);
189195
break;
190196
}
191-
case database::error::unvalidated:
197+
case database::error::block_confirmable:
192198
{
193-
post_block(link, bypass);
199+
complete_block(error::success, link, height, true);
194200
break;
195201
}
196202
case database::error::block_unconfirmable:

0 commit comments

Comments
 (0)