func (evpool *EvidencePool) MarkEvidenceAsCommitted(height int64, evidence []types.Evidence) {
	blockEvidenceMap := make(map[string]struct{})
	for _, ev := range evidence {
		evpool.evidenceStore.MarkEvidenceAsCommitted(ev)
		blockEvidenceMap[evMapKey(ev)] = struct{}{}
	}
	maxAge := evpool.State().ConsensusParams.Evidence.MaxAge
	evpool.removeEvidence(height, maxAge, blockEvidenceMap)
}
MarkEvidenceAsCommitted marks all the evidence as committed and removes it from the queue.
package evidence
import (
	"fmt"
	"sync"
	clist "github.com/XuanMaoSecLab/DolphinChain/libs/clist"
	dbm "github.com/XuanMaoSecLab/DolphinChain/libs/db"
	"github.com/XuanMaoSecLab/DolphinChain/libs/log"
	sm "github.com/XuanMaoSecLab/DolphinChain/state"
	"github.com/XuanMaoSecLab/DolphinChain/types"
)
type EvidencePool struct {
	logger log.Logger
	evidenceStore *EvidenceStore
	evidenceList  *clist.CList  
	stateDB dbm.DB
	mtx   sync.Mutex
	state sm.State
}
func NewEvidencePool(stateDB, evidenceDB dbm.DB) *EvidencePool {
	evidenceStore := NewEvidenceStore(evidenceDB)
	evpool := &EvidencePool{
		stateDB:       stateDB,
		state:         sm.LoadState(stateDB),
		logger:        log.NewNopLogger(),
		evidenceStore: evidenceStore,
		evidenceList:  clist.New(),
	}
	return evpool
}
func (evpool *EvidencePool) EvidenceFront() *clist.CElement {
	return evpool.evidenceList.Front()
}
func (evpool *EvidencePool) EvidenceWaitChan() <-chan struct{} {
	return evpool.evidenceList.WaitChan()
}
func (evpool *EvidencePool) SetLogger(l log.Logger) {
	evpool.logger = l
}
func (evpool *EvidencePool) PriorityEvidence() []types.Evidence {
	return evpool.evidenceStore.PriorityEvidence()
}
func (evpool *EvidencePool) PendingEvidence(maxNum int64) []types.Evidence {
	return evpool.evidenceStore.PendingEvidence(maxNum)
}
func (evpool *EvidencePool) State() sm.State {
	evpool.mtx.Lock()
	defer evpool.mtx.Unlock()
	return evpool.state
}
func (evpool *EvidencePool) Update(block *types.Block, state sm.State) {
	if state.LastBlockHeight != block.Height {
		panic(fmt.Sprintf("Failed EvidencePool.Update sanity check: got state.Height=%d with block.Height=%d", state.LastBlockHeight, block.Height))
	}
	evpool.mtx.Lock()
	evpool.state = state
	evpool.mtx.Unlock()
	evpool.MarkEvidenceAsCommitted(block.Height, block.Evidence.Evidence)
}
func (evpool *EvidencePool) AddEvidence(evidence types.Evidence) (err error) {
	if err := sm.VerifyEvidence(evpool.stateDB, evpool.State(), evidence); err != nil {
		return err
	}
	valset, _ := sm.LoadValidators(evpool.stateDB, evidence.Height())
	_, val := valset.GetByAddress(evidence.Address())
	priority := val.VotingPower
	added := evpool.evidenceStore.AddNewEvidence(evidence, priority)
	if !added {
		return
	}
	evpool.logger.Info("Verified new evidence of byzantine behaviour", "evidence", evidence)
	evpool.evidenceList.PushBack(evidence)
	return nil
}