| 714 | } |
| 715 | |
| 716 | void Client::checkWatchGarbage() |
| 717 | { |
| 718 | if (chrono::system_clock::now() - m_lastGarbageCollection > chrono::seconds(5)) |
| 719 | { |
| 720 | // watches garbage collection |
| 721 | vector<unsigned> toUninstall; |
| 722 | DEV_GUARDED(x_filtersWatches) |
| 723 | for (auto key: keysOf(m_watches)) |
| 724 | if (m_watches[key].lastPoll != chrono::system_clock::time_point::max() && chrono::system_clock::now() - m_watches[key].lastPoll > chrono::seconds(20)) |
| 725 | { |
| 726 | toUninstall.push_back(key); |
| 727 | clog(ClientTrace) << "GC: Uninstall" << key << "(" << chrono::duration_cast<chrono::seconds>(chrono::system_clock::now() - m_watches[key].lastPoll).count() << "s old)"; |
| 728 | } |
| 729 | for (auto i: toUninstall) |
| 730 | uninstallWatch(i); |
| 731 | |
| 732 | // blockchain GC |
| 733 | bc().garbageCollect(); |
| 734 | |
| 735 | m_lastGarbageCollection = chrono::system_clock::now(); |
| 736 | } |
| 737 | } |
| 738 | |
| 739 | void Client::prepareForTransaction() |
| 740 | { |
nothing calls this directly
no test coverage detected