Commit f5149dd
validation: mark blocks building on an invalid block as BLOCK_FAILED_CHILD
Without doing so, header-only chains building on a chain that
will be marked as invalid would still be eligible for m_best_header.
This improves both getblockchaininfo and getchaintips behavior.
While this adds an iteration over the entire block index, it can only be
triggered by the user (invalidateblock) or by others at a cost (the
header needs to be accepted in the first place, so it needs valid PoW).
Co-authored-by: TheCharlatan <[email protected]>1 parent 783cb73 commit f5149dd
File tree
3 files changed
+39
-1
lines changed- src
- test/functional
3 files changed
+39
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2045 | 2045 | | |
2046 | 2046 | | |
2047 | 2047 | | |
| 2048 | + | |
2048 | 2049 | | |
2049 | 2050 | | |
2050 | 2051 | | |
| |||
3785 | 3786 | | |
3786 | 3787 | | |
3787 | 3788 | | |
| 3789 | + | |
| 3790 | + | |
| 3791 | + | |
| 3792 | + | |
| 3793 | + | |
| 3794 | + | |
| 3795 | + | |
| 3796 | + | |
| 3797 | + | |
| 3798 | + | |
| 3799 | + | |
3788 | 3800 | | |
3789 | 3801 | | |
3790 | 3802 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
738 | 741 | | |
739 | 742 | | |
740 | 743 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
38 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
39 | 51 | | |
40 | 52 | | |
| 53 | + | |
41 | 54 | | |
42 | 55 | | |
43 | 56 | | |
44 | 57 | | |
45 | 58 | | |
46 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
47 | 70 | | |
48 | 71 | | |
49 | 72 | | |
| |||
0 commit comments