Stop terminates the transaction pool.
()
| 539 | |
| 540 | // Stop terminates the transaction pool. |
| 541 | func (pool *TxPool) Stop() { |
| 542 | // Unsubscribe all subscriptions registered from txpool |
| 543 | pool.scope.Close() |
| 544 | |
| 545 | // Unsubscribe subscriptions registered from blockchain |
| 546 | pool.chainHeadSub.Unsubscribe() |
| 547 | pool.wg.Wait() |
| 548 | |
| 549 | if pool.journal != nil { |
| 550 | pool.journal.close() |
| 551 | } |
| 552 | log.Info("Transaction pool stopped") |
| 553 | } |
| 554 | |
| 555 | // SubscribeNewTxsEvent registers a subscription of NewTxsEvent and |
| 556 | // starts sending event to the given channel. |