MCPcopy Create free account
hub / github.com/DNAProject/DNA / CleanTransactionList

Method CleanTransactionList

txnpool/common/transaction_pool.go:83–98  ·  view source on GitHub ↗

CleanTransactionList cleans the transaction list included in the ledger.

(txs []*types.Transaction)

Source from the content-addressed store, hash-verified

81
82// CleanTransactionList cleans the transaction list included in the ledger.
83func (tp *TXPool) CleanTransactionList(txs []*types.Transaction) error {
84 cleaned := 0
85 txsNum := len(txs)
86 tp.Lock()
87 defer tp.Unlock()
88 for _, tx := range txs {
89 if _, ok := tp.txList[tx.Hash()]; ok {
90 delete(tp.txList, tx.Hash())
91 cleaned++
92 }
93 }
94
95 log.Debugf("CleanTransactionList: transaction %d requested,%d cleaned, remains %d in TxPool",
96 txsNum, cleaned, len(tp.txList))
97 return nil
98}
99
100// DelTxList removes a single transaction from the pool.
101func (tp *TXPool) DelTxList(tx *types.Transaction) bool {

Callers 2

TestTxPoolFunction · 0.95
cleanTransactionListMethod · 0.80

Calls 2

DebugfFunction · 0.92
HashMethod · 0.65

Tested by 1

TestTxPoolFunction · 0.76