-type bbft struct {
- consensusNodeManager *consensusNodeManager
- orphanManage *OrphanManage
- signatureCache *lru.Cache
- eventDispatcher *event.Dispatcher
-}
-
-func newBbft(store Store, blockIndex *state.BlockIndex, orphanManage *OrphanManage, eventDispatcher *event.Dispatcher) *bbft {
- return &bbft{
- orphanManage: orphanManage,
- consensusNodeManager: newConsensusNodeManager(store, blockIndex),
- signatureCache: lru.New(maxSignatureCacheSize),
- eventDispatcher: eventDispatcher,
- }
-}
-
-// IsConsensusPubkey determine whether a public key is a consensus node at a specified height
-func (b *bbft) IsConsensusPubkey(blockHash *bc.Hash, pubkey []byte) (bool, error) {
- node, err := b.consensusNodeManager.getConsensusNode(blockHash, hex.EncodeToString(pubkey))
- if err != nil && err != errNotFoundConsensusNode {
- return false, err
- }
- return node != nil, nil
+func signCacheKey(blockHash, pubkey string) string {
+ return fmt.Sprintf("%s:%s", blockHash, pubkey)