Skip to content

Commit

Permalink
Removed logging for diff context
Browse files Browse the repository at this point in the history
  • Loading branch information
alanorwick committed Mar 4, 2022
1 parent 887fb22 commit cf593bc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions consensus/ethash/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,6 @@ func (ethash *Ethash) GetCoincidentHeader(chain consensus.ChainHeaderReader, con
} else if context == 1 {
difficultyContext, err := ethash.GetDifficultyContext(chain, header, context)
if err != nil {
log.Warn("Unable to calculate difficulty context")
return header, context
}

Expand All @@ -684,7 +683,6 @@ func (ethash *Ethash) GetCoincidentHeader(chain consensus.ChainHeaderReader, con
// difficultyContext is initially context since it could be a pending block w/o a nonce.
difficultyContext, err := ethash.GetDifficultyContext(chain, header, context)
if err != nil {
log.Warn("Unable to calculate difficulty context")
return header, context
}

Expand Down Expand Up @@ -741,7 +739,6 @@ func (ethash *Ethash) GetStopHash(chain consensus.ChainHeaderReader, originalCon
// difficultyContext is initially context since it could be a pending block w/o a nonce.
difficultyContext, err := ethash.GetDifficultyContext(chain, header, originalContext)
if err != nil {
log.Warn("Unable to calculate difficulty context")
break
}

Expand Down Expand Up @@ -824,12 +821,13 @@ func (ethash *Ethash) PrimeTraceBranch(chain consensus.ChainHeaderReader, header
}

header = prevHeader.Header()

if header == nil {
break
}
// Calculate the difficulty context in order to know if we have reached a coincident.
// If we get a coincident, stop and return.
difficultyContext, err := ethash.GetDifficultyContext(chain, header, context)
if err != nil {
log.Warn("Unable to calculate difficulty context")
break
}
if difficultyContext < context {
Expand Down Expand Up @@ -919,12 +917,13 @@ func (ethash *Ethash) RegionTraceBranch(chain consensus.ChainHeaderReader, heade
}

header = prevHeader.Header()

if header == nil {
break
}
// Calculate the difficulty context in order to know if we have reached a coincident.
// If we get a coincident, stop and return.
difficultyContext, err := ethash.GetDifficultyContext(chain, header, context)
if err != nil {
log.Warn("Unable to calculate difficulty context")
break
}
if difficultyContext < context && context == types.ContextDepth-1 {
Expand Down

0 comments on commit cf593bc

Please sign in to comment.