Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit d0976b2

Browse files
committed
Add another server to config
1 parent 875677e commit d0976b2

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

config.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
'''Parses configuration file and sets project wide constants.
2-
32
This file has intrinsic naming difficulties because it is trying to be platform
43
agnostic but naming variables is inherently platform specific (i.e directory vs
54
folder)
65
'''
76
__author__ = 'foxcarlos-TeamCreed', 'Tobin Harding'
87

98
import os
9+
from random import shuffle
1010
from platform import platform
1111
from os.path import expanduser, join, isfile
1212
from ConfigParser import ConfigParser
@@ -53,12 +53,10 @@ def str_to_bool(s):
5353
def _platform_agnostic_data_path(data_folder):
5454
'''
5555
Create absolute path name, exported as DATA_FOLDER.
56-
5756
User may configure using relative path, absolute path or use default.
5857
Relative path puts named folder in users home directory.
5958
Absolute path uses (obviously) the named absolute path.
6059
Default is currently to use 'OpenBazaar' in home directory.
61-
6260
See issue #163
6361
'''
6462
if data_folder:
@@ -115,7 +113,6 @@ def _is_osx():
115113
def _is_well_formed_seed_string(string):
116114
'''
117115
Parse string url:port,key
118-
119116
'''
120117
if ',' in string:
121118
url, key = string.split(',')
@@ -198,6 +195,7 @@ def _tuple_from_string(string):
198195
LIBBITCOIN_SERVERS.append(new_server)
199196
else:
200197
print 'Warning: please check your configuration file: %s' % server
198+
shuffle(LIBBITCOIN_SERVERS)
201199

202200
items = cfg.items('LIBBITCOIN_SERVERS_TESTNET') # this also includes items in DEFAULTS
203201
for item in items:
@@ -211,6 +209,7 @@ def _tuple_from_string(string):
211209
LIBBITCOIN_SERVERS_TESTNET.append(new_server)
212210
else:
213211
print 'Warning: please check your configuration file: %s' % server
212+
shuffle(LIBBITCOIN_SERVERS_TESTNET)
214213

215214

216215
def set_value(section, name, value):

ob.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ RESOLVER = https://resolver.onename.com/
1212
server1 = tcp://libbitcoin1.openbazaar.org:9091
1313

1414
[LIBBITCOIN_SERVERS_TESTNET]
15-
testnet_server2 = tcp://libbitcoin2.openbazaar.org:9091,<Z&{.=LJSPySefIKgCu99w.L%b^6VvuVp0+pbnOM
15+
testnet_server2 = tcp://libbitcoin2.openbazaar.org:9091
16+
testnet_server4 = tcp://libbitcoin4.openbazaar.org:9091,<Z&{.=LJSPySefIKgCu99w.L%b^6VvuVp0+pbnOM
1617

1718
[AUTHENTICATION]
1819
#SSL = False
@@ -24,5 +25,4 @@ testnet_server2 = tcp://libbitcoin2.openbazaar.org:9091,<Z&{.=LJSPySefIKgCu99w.L
2425
#PASSWORD = password
2526

2627
[SEEDS]
27-
seed1 = seed.openbazaar.org:8080,5b44be5c18ced1bc9400fe5e79c8ab90204f06bebacc04dd9c70a95eaca6e117
28-
28+
seed1 = seed.openbazaar.org:8080,5b44be5c18ced1bc9400fe5e79c8ab90204f06bebacc04dd9c70a95eaca6e117

0 commit comments

Comments
 (0)