1
0

refactor network constants

This commit is contained in:
SomberNight
2018-03-04 22:10:59 +01:00
parent 10057b18de
commit 81b6d65764
16 changed files with 191 additions and 132 deletions

View File

@@ -31,7 +31,7 @@ from PyQt5.QtWidgets import *
import PyQt5.QtCore as QtCore
from electrum.i18n import _
from electrum.bitcoin import NetworkConstants
from electrum import constants
from electrum.util import print_error
from electrum.network import serialize_server, deserialize_server
@@ -393,7 +393,7 @@ class NetworkChoiceLayout(object):
def change_protocol(self, use_ssl):
p = 's' if use_ssl else 't'
host = self.server_host.text()
pp = self.servers.get(host, NetworkConstants.DEFAULT_PORTS)
pp = self.servers.get(host, constants.net.DEFAULT_PORTS)
if p not in pp.keys():
p = list(pp.keys())[0]
port = pp[p]
@@ -418,7 +418,7 @@ class NetworkChoiceLayout(object):
self.change_server(str(x.text(0)), self.protocol)
def change_server(self, host, protocol):
pp = self.servers.get(host, NetworkConstants.DEFAULT_PORTS)
pp = self.servers.get(host, constants.net.DEFAULT_PORTS)
if protocol and protocol not in protocol_letters:
protocol = None
if protocol: