From 983943b7cef1c40248f4bbfe9eeea13d802e7573 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Mon, 16 May 2022 22:07:38 -0500 Subject: [PATCH] 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. --- internal/mempool/mempool.go | 3 +-- server.go | 16 +--------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/internal/mempool/mempool.go b/internal/mempool/mempool.go index e8ae400f..a08e2f36 100644 --- a/internal/mempool/mempool.go +++ b/internal/mempool/mempool.go @@ -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() diff --git a/server.go b/server.go index c58d9be5..0105d811 100644 --- a/server.go +++ b/server.go @@ -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())