Peter Surda
c778b81427
- saveKnownNodes replaced the repeated pickle.dump - with knownNodesLock instead of acquire/release - outgoingSynSender had an unnecessary loop during shutdown causing excessive CPU usage / GUI freezing
15 lines
321 B
Python
15 lines
321 B
Python
import pickle
|
|
import threading
|
|
|
|
import state
|
|
|
|
knownNodesLock = threading.Lock()
|
|
knownNodes = {}
|
|
|
|
def saveKnownNodes(dirName = None):
|
|
if dirName is None:
|
|
dirName = state.appdata
|
|
with knownNodesLock:
|
|
with open(dirName + 'knownnodes.dat', 'wb') as output:
|
|
pickle.dump(knownNodes, output)
|