We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 65ab4ef + f17dee9 commit fa03491Copy full SHA for fa03491
backend/coins/btc/headers/headers.go
@@ -366,10 +366,7 @@ func (headers *Headers) reorg(db DBInterface, tip int) {
366
// Simple reorg method: re-fetch headers up to the maximum reorg limit. The server can shorten
367
// our chain by sending a fake header and set us back by `reorgLimit` blocks, but it needs to
368
// contain the correct PoW to do so.
369
- newTip := tip - reorgLimit
370
- if newTip < -1 {
371
- newTip = -1
372
- }
+ newTip := max(tip-reorgLimit, -1)
373
if err := db.RevertTo(newTip); err != nil {
374
panic(err)
375
}
0 commit comments