mempool: Remove agendas from RemoveOrphan.

This removes the treasury and auto revocations agenda flags from the
exported RemoveOrphan method since they are no longer used.
This commit is contained in:
Dave Collins 2022-05-16 22:06:16 -05:00
parent 2521b6c3df
commit fdde83c23c
No known key found for this signature in database
GPG Key ID: B8904D9D9C93D1F2
3 changed files with 7 additions and 10 deletions

View File

@ -444,9 +444,7 @@ func (mp *TxPool) removeOrphan(tx *dcrutil.Tx, removeRedeemers bool) {
// previous orphan index.
//
// This function is safe for concurrent access.
func (mp *TxPool) RemoveOrphan(tx *dcrutil.Tx, isTreasuryEnabled,
isAutoRevocationsEnabled bool) {
func (mp *TxPool) RemoveOrphan(tx *dcrutil.Tx) {
mp.mtx.Lock()
mp.removeOrphan(tx, false)
mp.mtx.Unlock()
@ -1555,8 +1553,7 @@ func (mp *TxPool) maybeAcceptTransaction(tx *dcrutil.Tx, isNew, rateLimit,
// Don't allow transactions with non-standard inputs if the mempool config
// forbids their acceptance and relaying.
if !mp.cfg.Policy.AcceptNonStd {
err := checkInputsStandard(tx, txType, utxoView,
isTreasuryEnabled)
err := checkInputsStandard(tx, txType, utxoView, isTreasuryEnabled)
if err != nil {
str := fmt.Sprintf("transaction %v has a non-standard "+
"input: %v", txHash, err)

View File

@ -1455,7 +1455,7 @@ func TestBasicOrphanRemoval(t *testing.T) {
t.Fatalf("unable to create signed tx: %v", err)
}
harness.txPool.RemoveOrphan(nonChainedOrphanTx, noTreasury, noAutoRevocations)
harness.txPool.RemoveOrphan(nonChainedOrphanTx)
testPoolMembership(tc, nonChainedOrphanTx, false, false)
for _, tx := range chainedTxns[1 : maxOrphans+1] {
testPoolMembership(tc, tx, true, false)
@ -1464,7 +1464,7 @@ func TestBasicOrphanRemoval(t *testing.T) {
// Attempt to remove an orphan that has an existing redeemer but itself
// is not present and ensure the state of all other orphans (including
// the one that redeems it) are unaffected.
harness.txPool.RemoveOrphan(chainedTxns[0], noTreasury, noAutoRevocations)
harness.txPool.RemoveOrphan(chainedTxns[0])
testPoolMembership(tc, chainedTxns[0], false, false)
for _, tx := range chainedTxns[1 : maxOrphans+1] {
testPoolMembership(tc, tx, true, false)
@ -1473,7 +1473,7 @@ func TestBasicOrphanRemoval(t *testing.T) {
// Remove each orphan one-by-one and ensure they are removed as
// expected.
for _, tx := range chainedTxns[1 : maxOrphans+1] {
harness.txPool.RemoveOrphan(tx, noTreasury, noAutoRevocations)
harness.txPool.RemoveOrphan(tx)
testPoolMembership(tc, tx, false, false)
}
}

View File

@ -2698,7 +2698,7 @@ func (s *server) handleBlockchainNotification(notification *blockchain.Notificat
txMemPool.MaybeAcceptDependents(tx, isTreasuryEnabled)
txMemPool.RemoveDoubleSpends(tx, isTreasuryEnabled,
isAutoRevocationsEnabled)
txMemPool.RemoveOrphan(tx, isTreasuryEnabled, isAutoRevocationsEnabled)
txMemPool.RemoveOrphan(tx)
acceptedTxs := txMemPool.ProcessOrphans(tx, ntfn.CheckTxFlags)
s.AnnounceNewTransactions(acceptedTxs)
@ -2822,7 +2822,7 @@ func (s *server) handleBlockchainNotification(notification *blockchain.Notificat
txMemPool.MaybeAcceptDependents(tx, isTreasuryEnabled)
txMemPool.RemoveDoubleSpends(tx, isTreasuryEnabled,
isAutoRevocationsEnabled)
txMemPool.RemoveOrphan(tx, isTreasuryEnabled, isAutoRevocationsEnabled)
txMemPool.RemoveOrphan(tx)
txMemPool.ProcessOrphans(tx, ntfn.CheckTxFlags)
}
}