X-Git-Url: http://git.osdn.net/view?p=bytom%2Fvapor.git;a=blobdiff_plain;f=protocol%2Fprotocol.go;fp=protocol%2Fprotocol.go;h=98b285b032ccdf59d9a49ef1a53db1e218600891;hp=ee3114e9f1bfc468b1fb6230b7b71ce044ff03e1;hb=a6f99bcae0c1f80ff65708b65ab03244c0a2fecc;hpb=232c4d924956f0945db38bf2cc8ecfb87f3c445f diff --git a/protocol/protocol.go b/protocol/protocol.go index ee3114e9..98b285b0 100644 --- a/protocol/protocol.go +++ b/protocol/protocol.go @@ -3,7 +3,6 @@ package protocol import ( "sync" - "github.com/golang/groupcache/lru" log "github.com/sirupsen/logrus" "github.com/vapor/config" @@ -11,6 +10,7 @@ import ( "github.com/vapor/protocol/bc" "github.com/vapor/protocol/bc/types" "github.com/vapor/protocol/state" + "github.com/vapor/common" ) const maxProcessBlockChSize = 1024 @@ -24,7 +24,7 @@ type Chain struct { processBlockCh chan *processBlockMsg consensusNodeManager *consensusNodeManager - signatureCache *lru.Cache + signatureCache *common.Cache eventDispatcher *event.Dispatcher cond sync.Cond @@ -38,7 +38,7 @@ func NewChain(store Store, txPool *TxPool, eventDispatcher *event.Dispatcher) (* orphanManage: NewOrphanManage(), txPool: txPool, store: store, - signatureCache: lru.New(maxSignatureCacheSize), + signatureCache: common.NewCache(maxSignatureCacheSize), eventDispatcher: eventDispatcher, processBlockCh: make(chan *processBlockMsg, maxProcessBlockChSize), }