Commit 1892b3c
Do not request older headers if re-organization is not occurred
Header downloader has "best_hash," which is peer's best hash, and
"pivot," which is the best hash of received headers from a peer.
When header downloader receives headers from a peer, it checks the
first header's hash and the pivot's hash. If they are not the same,
the downloader concludes that there is a reorganization and request
older headers.
However, if the pivot is changed between header request and response,
the header downloader requests older hashes even though there is no
re-organization. This commit changes the header downloader check
re-organization more concisely.1 parent 9775908 commit 1892b3c
1 file changed
+18
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
| |||
158 | 161 | | |
159 | 162 | | |
160 | 163 | | |
161 | | - | |
162 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
163 | 170 | | |
164 | 171 | | |
165 | 172 | | |
166 | 173 | | |
167 | 174 | | |
168 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
169 | 184 | | |
170 | 185 | | |
171 | 186 | | |
| |||
0 commit comments