mempool: Remove agendas from limitNumOrphans.

This removes the treasury and auto revocations agenda flags from the
unexported limitNumOrphans method since they are no longer used.
This commit is contained in:
Dave Collins 2022-05-16 21:37:39 -05:00
parent 6b43d19df2
commit e02c8a1d72
No known key found for this signature in database
GPG Key ID: B8904D9D9C93D1F2

View File

@ -475,7 +475,7 @@ func (mp *TxPool) RemoveOrphansByTag(tag Tag, isTreasuryEnabled,
// orphan if adding a new one would cause it to overflow the max allowed.
//
// This function MUST be called with the mempool lock held (for writes).
func (mp *TxPool) limitNumOrphans(isTreasuryEnabled, isAutoRevocationsEnabled bool) {
func (mp *TxPool) limitNumOrphans() {
// Scan through the orphan pool and remove any expired orphans when it's
// time. This is done for efficiency so the scan only happens periodically
// instead of on every orphan added to the pool.
@ -534,7 +534,7 @@ func (mp *TxPool) addOrphan(tx *dcrutil.Tx, tag Tag, isTreasuryEnabled,
// Limit the number orphan transactions to prevent memory exhaustion.
// This will periodically remove any expired orphans and evict a random
// orphan if space is still needed.
mp.limitNumOrphans(isTreasuryEnabled, isAutoRevocationsEnabled)
mp.limitNumOrphans()
mp.orphans[*tx.Hash()] = &orphanTx{
tx: tx,