You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
printself, 'connected to', HOST, 'during an outgoing attempt.'
121
-
shared.printLock.release()
119
+
withshared.printLock:
120
+
printself, 'connected to', HOST, 'during an outgoing attempt.'
121
+
122
122
123
123
sd=sendDataThread()
124
124
sd.setup(sock, HOST, PORT, self.streamNumber,
@@ -128,18 +128,18 @@ def run(self):
128
128
129
129
exceptsocks.GeneralProxyErroraserr:
130
130
ifshared.verbose>=2:
131
-
shared.printLock.acquire()
132
-
print'Could NOT connect to', HOST, 'during outgoing attempt.', err
133
-
shared.printLock.release()
131
+
withshared.printLock:
132
+
print'Could NOT connect to', HOST, 'during outgoing attempt.', err
133
+
134
134
PORT, timeLastSeen=shared.knownNodes[
135
135
self.streamNumber][HOST]
136
136
if (int(time.time()) -timeLastSeen) >172800andlen(shared.knownNodes[self.streamNumber]) >1000: # for nodes older than 48 hours old if we have more than 1000 hosts in our list, delete from the shared.knownNodes data-structure.
137
137
shared.knownNodesLock.acquire()
138
138
delshared.knownNodes[self.streamNumber][HOST]
139
139
shared.knownNodesLock.release()
140
-
shared.printLock.acquire()
141
-
print'deleting ', HOST, 'from shared.knownNodes because it is more than 48 hours old and we could not connect to it.'
142
-
shared.printLock.release()
140
+
withshared.printLock:
141
+
print'deleting ', HOST, 'from shared.knownNodes because it is more than 48 hours old and we could not connect to it.'
142
+
143
143
exceptsocks.Socks5AuthErroraserr:
144
144
shared.UISignalQueue.put((
145
145
'updateStatusBar', tr.translateText(
@@ -154,18 +154,18 @@ def run(self):
154
154
print'Bitmessage MIGHT be having trouble connecting to the SOCKS server. '+str(err)
155
155
else:
156
156
ifshared.verbose>=1:
157
-
shared.printLock.acquire()
158
-
print'Could NOT connect to', HOST, 'during outgoing attempt.', err
159
-
shared.printLock.release()
157
+
withshared.printLock:
158
+
print'Could NOT connect to', HOST, 'during outgoing attempt.', err
159
+
160
160
PORT, timeLastSeen=shared.knownNodes[
161
161
self.streamNumber][HOST]
162
162
if (int(time.time()) -timeLastSeen) >172800andlen(shared.knownNodes[self.streamNumber]) >1000: # for nodes older than 48 hours old if we have more than 1000 hosts in our list, delete from the knownNodes data-structure.
163
163
shared.knownNodesLock.acquire()
164
164
delshared.knownNodes[self.streamNumber][HOST]
165
165
shared.knownNodesLock.release()
166
-
shared.printLock.acquire()
167
-
print'deleting ', HOST, 'from knownNodes because it is more than 48 hours old and we could not connect to it.'
168
-
shared.printLock.release()
166
+
withshared.printLock:
167
+
print'deleting ', HOST, 'from knownNodes because it is more than 48 hours old and we could not connect to it.'
168
+
169
169
exceptExceptionaserr:
170
170
sys.stderr.write(
171
171
'An exception has occurred in the outgoingSynSender thread that was not caught by other exception types: ')
0 commit comments