CleanTransactionList cleans the transaction list included in the ledger.
(txs []*types.Transaction)
| 81 | |
| 82 | // CleanTransactionList cleans the transaction list included in the ledger. |
| 83 | func (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. |
| 101 | func (tp *TXPool) DelTxList(tx *types.Transaction) bool { |