Moved offllinePeers to KV to further reduce coupling
This commit is contained in:
parent
10c1cd7803
commit
dde10b7005
6 changed files with 12 additions and 6 deletions
|
@ -32,8 +32,8 @@ from coredb import keydb
|
|||
def connect_new_peer_to_communicator(comm_inst, peer='', useBootstrap=False):
|
||||
config = comm_inst.config
|
||||
retData = False
|
||||
tried = comm_inst.offlinePeers
|
||||
kv: "DeadSimpleKV" = comm_inst.shared_state.get_by_string("DeadSimpleKV")
|
||||
tried = kv.get('offlinePeers')
|
||||
transports = gettransports.get()
|
||||
if peer != '':
|
||||
if stringvalidators.validate_transport(peer):
|
||||
|
|
|
@ -54,7 +54,7 @@ def net_check(comm_inst):
|
|||
'This is usually temporary, but bugs and censorship can cause this to persist, in which case you should report it to beardog [at] mailbox.org', # noqa
|
||||
terminal=True)
|
||||
restarttor.restart(comm_inst)
|
||||
comm_inst.offlinePeers = []
|
||||
kv.put('offlinePeers', [])
|
||||
comm_inst.isOnline = False
|
||||
else:
|
||||
comm_inst.isOnline = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue