OSDN Git Service

fix_no_add_score_when_double_sign (#542)
authorPoseidon <shenao.78@163.com>
Fri, 7 Aug 2020 08:50:04 +0000 (16:50 +0800)
committerGitHub <noreply@github.com>
Fri, 7 Aug 2020 08:50:04 +0000 (16:50 +0800)
netsync/chainmgr/block_keeper.go

index 5752377..7707cff 100644 (file)
@@ -171,8 +171,10 @@ func (bk *blockKeeper) regularBlockSync() error {
                }
 
                isOrphan, err := bk.chain.ProcessBlock(block)
-               if err != nil && errors.Root(err) != protocol.ErrDoubleSignBlock {
-                       bk.peers.ProcessIllegal(bk.syncPeer.ID(), security.LevelMsgIllegal, err.Error())
+               if err != nil {
+                       if errors.Root(err) != protocol.ErrDoubleSignBlock {
+                               bk.peers.ProcessIllegal(bk.syncPeer.ID(), security.LevelMsgIllegal, err.Error())
+                       }
                        return err
                }