OSDN Git Service

Del signature from cache when added to the block (#258)
authoryahtoo <yahtoo.ma@gmail.com>
Thu, 11 Jul 2019 06:39:21 +0000 (14:39 +0800)
committerPaladz <yzhu101@uottawa.ca>
Thu, 11 Jul 2019 06:39:21 +0000 (14:39 +0800)
protocol/bbft.go

index 70b1d81..11dc0db 100644 (file)
@@ -132,6 +132,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))
                        cachekey := signCacheKey(blockHash.String(), pubKey)
                        if signature, ok := c.signatureCache.Get(cachekey); ok {
                                block.Set(node.Order, signature.([]byte))
+                               c.signatureCache.Remove(cachekey)
                        } else {
                                continue
                        }
                        } else {
                                continue
                        }