Skip to content

Commit

Permalink
No TTD mismatch if there's no TTD in chainConfig yet (#4852)
Browse files Browse the repository at this point in the history
  • Loading branch information
yperbasis authored Jul 28, 2022
1 parent 7ae9988 commit 59bcbb4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions cmd/rpcdaemon22/commands/engine_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,7 @@ func (e *EngineImpl) ExchangeTransitionConfigurationV1(ctx context.Context, beac
}

terminalTotalDifficulty := chainConfig.TerminalTotalDifficulty

if terminalTotalDifficulty == nil {
return TransitionConfiguration{}, fmt.Errorf("the execution layer doesn't have a terminal total difficulty. expected: %v", beaconConfig.TerminalTotalDifficulty)
}

if terminalTotalDifficulty.Cmp((*big.Int)(beaconConfig.TerminalTotalDifficulty)) != 0 {
if terminalTotalDifficulty != nil && terminalTotalDifficulty.Cmp((*big.Int)(beaconConfig.TerminalTotalDifficulty)) != 0 {
return TransitionConfiguration{}, fmt.Errorf("the execution layer has a wrong terminal total difficulty. expected %v, but instead got: %d", beaconConfig.TerminalTotalDifficulty, terminalTotalDifficulty)
}

Expand Down

0 comments on commit 59bcbb4

Please sign in to comment.