OSDN Git Service

try to fix ban peer bug (#273)
authorPaladz <yzhu101@uottawa.ca>
Fri, 12 Jul 2019 13:38:00 +0000 (21:38 +0800)
committerGitHub <noreply@github.com>
Fri, 12 Jul 2019 13:38:00 +0000 (21:38 +0800)
protocol/bbft.go

index f865897..a6a6deb 100644 (file)
@@ -133,7 +133,7 @@ func (c *Chain) validateSign(block *types.Block) error {
                        cachekey := signCacheKey(blockHash.String(), pubKey)
                        if signature, ok := c.signatureCache.Get(cachekey); ok {
                                block.Set(node.Order, signature.([]byte))
-                               c.eventDispatcher.Post(event.BlockSignatureEvent{BlockHash: blockHash, Signature: signature.([]byte), XPub: []byte(pubKey)})
+                               c.eventDispatcher.Post(event.BlockSignatureEvent{BlockHash: blockHash, Signature: signature.([]byte), XPub: node.XPub[:]})
                                c.signatureCache.Remove(cachekey)
                        } else {
                                continue