MCPcopy Create free account
hub / github.com/LUX-Core/lux / checkWatchGarbage

Method checkWatchGarbage

src/cpp-ethereum/libethereum/Client.cpp:716–737  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

714}
715
716void 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
739void Client::prepareForTransaction()
740{

Callers

nothing calls this directly

Calls 6

keysOfFunction · 0.85
maxFunction · 0.85
garbageCollectMethod · 0.80
DEV_GUARDEDFunction · 0.70
push_backMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected