pybitmessage.class_singleCleaner module

The singleCleaner class is a timer-driven thread that cleans data structures to free memory, resends messages when a remote node doesn’t respond, and sends pong messages to keep connections alive if the network isn’t busy.

It cleans these data structures in memory:
  • inventory (moves data to the on-disk sql database)
  • inventorySets (clears then reloads data out of sql database)
It cleans these tables on the disk:
  • inventory (clears expired objects)
  • pubkeys (clears pubkeys older than 4 weeks old which we have not used personally)
  • knownNodes (clears addresses which have not been online for over 3 days)
It resends messages when there has been no response:
  • resends getpubkey messages in 5 days (then 10 days, then 20 days, etc…)
  • resends msg messages in 5 days (then 10 days, then 20 days, etc…)
class singleCleaner(name=None)[source]

Bases: pybitmessage.network.threads.StoppableThread

cycleLength = 300
expireDiscoveredPeers = 300
name = 'singleCleaner'
resendMsg(ackdata)

Resend message by ackdata

resendPubkeyRequest(address)

Resend pubkey request for address

run()

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.