Skip to content

Commit d4f7ed3

Browse files
committed
Merge pull request #69
1c3bf3a add support of "rpcconnect" parameter of bitcoin.conf (f1qwase)
2 parents 1df4918 + 235190f commit d4f7ed3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bitcoin/rpc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def __init__(self, service_url=None,
9191
service_port = bitcoin.params.RPC_PORT
9292
conf['rpcport'] = int(conf.get('rpcport', service_port))
9393
conf['rpcssl'] = conf.get('rpcssl', '0')
94+
conf['rpchost'] = conf.get('rpcconnect', 'localhost')
9495

9596
if conf['rpcssl'].lower() in ('0', 'false'):
9697
conf['rpcssl'] = False
@@ -102,10 +103,10 @@ def __init__(self, service_url=None,
102103
if 'rpcpassword' not in conf:
103104
raise ValueError('The value of rpcpassword not specified in the configuration file: %s' % btc_conf_file)
104105

105-
service_url = ('%s://%s:%s@localhost:%d' %
106+
service_url = ('%s://%s:%s@%s:%d' %
106107
('https' if conf['rpcssl'] else 'http',
107108
conf['rpcuser'], conf['rpcpassword'],
108-
conf['rpcport']))
109+
conf['rpchost'], conf['rpcport']))
109110

110111
self.__service_url = service_url
111112
self.__url = urlparse.urlparse(service_url)

0 commit comments

Comments
 (0)