Page MenuHomePhabricator

Properly track the "best" invalid tip
ClosedPublic

Authored by deadalnix on Oct 20 2018, 16:19.

Details

Summary

As it turn out, some code path do select the best block that's actually invalid, not it's child with the most proof of work.

To fix that problem, we delegate the responsability of finding such block to FindMostWorkChain and remove them from the candidate list.

Test Plan
make check
./src/bitcoind -regtest -printtoconsole
./src/bitcoin-cli generate 100
./src/bitcoin-cli invalidateblock <block hash that is 6+ block deep>

Check that the node warn about a large invalid chain being present.

Depends on D1942

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable