mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
eth/catalyst: allow reorg depth equal to maxReorgDepth (#35391)
The deep-reorg check used depth >= maxReorgDepth, rejecting reorgs at exactly the configured limit. Use > so a depth equal to maxReorgDepth is still accepted.
This commit is contained in:
parent
f03b91cf28
commit
b2ee83931b
1 changed files with 1 additions and 1 deletions
|
|
@ -338,7 +338,7 @@ func (api *ConsensusAPI) forkchoiceUpdated(ctx context.Context, update engine.Fo
|
||||||
return valid(nil), nil
|
return valid(nil), nil
|
||||||
}
|
}
|
||||||
depth := api.eth.BlockChain().CurrentBlock().Number.Uint64() - block.NumberU64()
|
depth := api.eth.BlockChain().CurrentBlock().Number.Uint64() - block.NumberU64()
|
||||||
if api.maxReorgDepth > 0 && depth >= api.maxReorgDepth {
|
if api.maxReorgDepth > 0 && depth > api.maxReorgDepth {
|
||||||
log.Warn("Refusing too deep reorg", "depth", depth, "head", update.HeadBlockHash)
|
log.Warn("Refusing too deep reorg", "depth", depth, "head", update.HeadBlockHash)
|
||||||
return engine.STATUS_INVALID, engine.TooDeepReorg.With(fmt.Errorf("reorg depth %d exceeds limit %d", depth, api.maxReorgDepth))
|
return engine.STATUS_INVALID, engine.TooDeepReorg.With(fmt.Errorf("reorg depth %d exceeds limit %d", depth, api.maxReorgDepth))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue