shared.connectedHostsList is obsolete
This commit is contained in:
parent
ee7aa6c28d
commit
5b5ec2b63d
|
@ -31,6 +31,8 @@ from pyelliptic.openssl import OpenSSL
|
||||||
import queues
|
import queues
|
||||||
import shared
|
import shared
|
||||||
import shutdown
|
import shutdown
|
||||||
|
import network.stats
|
||||||
|
|
||||||
|
|
||||||
quit = False
|
quit = False
|
||||||
menutab = 1
|
menutab = 1
|
||||||
|
@ -209,12 +211,16 @@ def drawtab(stdscr):
|
||||||
stdscr.addstr(6+i, 120, str(item[2]), a)
|
stdscr.addstr(6+i, 120, str(item[2]), a)
|
||||||
elif menutab == 8: # Network status
|
elif menutab == 8: # Network status
|
||||||
# Connection data
|
# Connection data
|
||||||
stdscr.addstr(4, 5, "Total Connections: "+str(len(shared.connectedHostsList)).ljust(2))
|
connected_hosts = network.stats.connectedHostsList()
|
||||||
|
stdscr.addstr(
|
||||||
|
4, 5, "Total Connections: " +
|
||||||
|
str(len(connected_hosts)).ljust(2)
|
||||||
|
)
|
||||||
stdscr.addstr(6, 6, "Stream #", curses.A_BOLD)
|
stdscr.addstr(6, 6, "Stream #", curses.A_BOLD)
|
||||||
stdscr.addstr(6, 18, "Connections", curses.A_BOLD)
|
stdscr.addstr(6, 18, "Connections", curses.A_BOLD)
|
||||||
stdscr.hline(7, 6, '-', 23)
|
stdscr.hline(7, 6, '-', 23)
|
||||||
streamcount = []
|
streamcount = []
|
||||||
for host, stream in shared.connectedHostsList.items():
|
for host, stream in connected_hosts:
|
||||||
if stream >= len(streamcount):
|
if stream >= len(streamcount):
|
||||||
streamcount.append(1)
|
streamcount.append(1)
|
||||||
else:
|
else:
|
||||||
|
@ -776,7 +782,7 @@ def sendMessage(sender="", recv="", broadcast=None, subject="", body="", reply=F
|
||||||
set_background_title(d, "Recipient address error")
|
set_background_title(d, "Recipient address error")
|
||||||
scrollbox(d, unicode("Bitmessage currently only supports stream numbers of 1, unlike as requested for address " + addr + "."))
|
scrollbox(d, unicode("Bitmessage currently only supports stream numbers of 1, unlike as requested for address " + addr + "."))
|
||||||
continue
|
continue
|
||||||
if len(shared.connectedHostsList) == 0:
|
if not network.stats.connectedHostsList():
|
||||||
set_background_title(d, "Not connected warning")
|
set_background_title(d, "Not connected warning")
|
||||||
scrollbox(d, unicode("Because you are not currently connected to the network, "))
|
scrollbox(d, unicode("Because you are not currently connected to the network, "))
|
||||||
stealthLevel = BMConfigParser().safeGetInt('bitmessagesettings', 'ackstealthlevel')
|
stealthLevel = BMConfigParser().safeGetInt('bitmessagesettings', 'ackstealthlevel')
|
||||||
|
|
|
@ -431,7 +431,6 @@ class BMProto(AdvancedDispatcher, ObjectTracker):
|
||||||
if not self.peerValidityChecks():
|
if not self.peerValidityChecks():
|
||||||
# TODO ABORT
|
# TODO ABORT
|
||||||
return True
|
return True
|
||||||
#shared.connectedHostsList[self.destination] = self.streams[0]
|
|
||||||
self.append_write_buf(protocol.CreatePacket('verack'))
|
self.append_write_buf(protocol.CreatePacket('verack'))
|
||||||
self.verackSent = True
|
self.verackSent = True
|
||||||
if not self.isOutbound:
|
if not self.isOutbound:
|
||||||
|
|
|
@ -50,10 +50,7 @@ myAddressesByTag = {}
|
||||||
broadcastSendersForWhichImWatching = {}
|
broadcastSendersForWhichImWatching = {}
|
||||||
printLock = threading.Lock()
|
printLock = threading.Lock()
|
||||||
statusIconColor = 'red'
|
statusIconColor = 'red'
|
||||||
# List of hosts to which we are connected. Used to guarantee
|
|
||||||
# that the outgoingSynSender threads won't connect to the same
|
|
||||||
# remote node twice.
|
|
||||||
connectedHostsList = {}
|
|
||||||
thisapp = None # singleton lock instance
|
thisapp = None # singleton lock instance
|
||||||
alreadyAttemptedConnectionsList = {
|
alreadyAttemptedConnectionsList = {
|
||||||
} # This is a list of nodes to which we have already attempted a connection
|
} # This is a list of nodes to which we have already attempted a connection
|
||||||
|
|
Reference in New Issue
Block a user