cleanTransactionList cleans the txs in the block from the ledger
(txs []*tx.Transaction, height uint32)
| 529 | |
| 530 | // cleanTransactionList cleans the txs in the block from the ledger |
| 531 | func (s *TXPoolServer) cleanTransactionList(txs []*tx.Transaction, height uint32) { |
| 532 | s.txPool.CleanTransactionList(txs) |
| 533 | |
| 534 | // Check whether to update the gas price and remove txs below the |
| 535 | // threshold |
| 536 | if height%tc.UPDATE_FREQUENCY == 0 { |
| 537 | gasPrice := getGasPriceConfig() |
| 538 | s.mu.Lock() |
| 539 | oldGasPrice := s.gasPrice |
| 540 | s.gasPrice = gasPrice |
| 541 | s.mu.Unlock() |
| 542 | if oldGasPrice != gasPrice { |
| 543 | log.Infof("Transaction pool price threshold updated from %d to %d", |
| 544 | oldGasPrice, gasPrice) |
| 545 | } |
| 546 | |
| 547 | if oldGasPrice < gasPrice { |
| 548 | s.txPool.RemoveTxsBelowGasPrice(gasPrice) |
| 549 | } |
| 550 | } |
| 551 | // Cleanup tx pool |
| 552 | if !s.disablePreExec { |
| 553 | remain := s.txPool.Remain() |
| 554 | for _, t := range remain { |
| 555 | if ok, _ := preExecCheck(t); !ok { |
| 556 | log.Debugf("cleanTransactionList: preExecCheck tx %x failed", t.Hash()) |
| 557 | continue |
| 558 | } |
| 559 | s.reVerifyStateful(t, tc.NilSender) |
| 560 | } |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | // delTransaction deletes a transaction in the tx pool. |
| 565 | func (s *TXPoolServer) delTransaction(t *tx.Transaction) { |