mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
Only set TD if it's actually higher
This commit is contained in:
parent
73c4ca3a6f
commit
73123bf257
1 changed files with 4 additions and 1 deletions
|
|
@ -267,7 +267,10 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
|
|||
}
|
||||
|
||||
self.add(block)
|
||||
self.SetTotalDifficulty(td)
|
||||
if td.Cmp(self.TD) > 0 {
|
||||
self.SetTotalDifficulty(td)
|
||||
}
|
||||
|
||||
self.eventMux.Post(NewBlockEvent{block})
|
||||
self.eventMux.Post(messages)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue