From 73123bf257934e95e08311d4af9b3382f3dcdb39 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 4 Dec 2014 15:35:21 +0100 Subject: Only set TD if it's actually higher --- core/chain_manager.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/chain_manager.go b/core/chain_manager.go index 7acd171ec..7d4aeaab6 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -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) } -- cgit