mempool: Remove agendas from RemoveOrphansByTag.

This removes the treasury and auto revocations agenda flags from the
exported RemoveOrphansByTag method since they are no longer used.
This commit is contained in:
Dave Collins 2022-05-16 22:07:38 -05:00
parent fdde83c23c
commit 983943b7ce
No known key found for this signature in database
GPG Key ID: B8904D9D9C93D1F2
2 changed files with 2 additions and 17 deletions

View File

@ -454,8 +454,7 @@ func (mp *TxPool) RemoveOrphan(tx *dcrutil.Tx) {
// identifier.
//
// This function is safe for concurrent access.
func (mp *TxPool) RemoveOrphansByTag(tag Tag, isTreasuryEnabled,
isAutoRevocationsEnabled bool) uint64 {
func (mp *TxPool) RemoveOrphansByTag(tag Tag) uint64 {
var numEvicted uint64
mp.mtx.Lock()

View File

@ -2252,22 +2252,8 @@ func (s *server) peerDoneHandler(sp *serverPeer) {
}
if sp.VersionKnown() {
tipHash := &s.chain.BestSnapshot().Hash
isTreasuryEnabled, err := s.chain.IsTreasuryAgendaActive(tipHash)
if err != nil {
srvrLog.Errorf("Could not obtain treasury agenda status: %v", err)
}
isAutoRevocationsEnabled, err :=
s.chain.IsAutoRevocationsAgendaActive(tipHash)
if err != nil {
srvrLog.Errorf("Could not obtain automatic ticket revocations agenda "+
"status: %v", err)
}
// Evict any remaining orphans that were sent by the peer.
numEvicted := s.txMemPool.RemoveOrphansByTag(mempool.Tag(sp.ID()),
isTreasuryEnabled, isAutoRevocationsEnabled)
numEvicted := s.txMemPool.RemoveOrphansByTag(mempool.Tag(sp.ID()))
if numEvicted > 0 {
srvrLog.Debugf("Evicted %d %s from peer %v (id %d)", numEvicted,
pickNoun(numEvicted, "orphan", "orphans"), sp, sp.ID())