[bitcoin/bitcoin] Bugfix: the end of a reorged chain is invalid when connect fails (#13185)

Introduced in 4e0eed88acdd41826868c151373068bfad18b84d

When an invalid block is found during a reorg, we know the last of the blocks in the was-to-be-connected chain is invalid, but not necessarily the first. As `vpIndexToConnect` is ordered in decreasing height, the end of the reorg is the front of the vector, and not the back.

This only affected the warning system.
You can view, comment on, or merge this pull request online at:

https://github.com/bitcoin/bitcoin/pull/13185

— Commit Summary —

* Bugfix: the end of a reorged chain is invalid when connect fails

— File Changes —

M src/validation.cpp (5)

— Patch Links —

https://github.com/bitcoin/bitcoin/pull/13185.patch
https://github.com/bitcoin/bitcoin/pull/13185.diff

Запись редактировалась последний раз: May 7, 2018, 8:26 pm