Skip to content

Commit d01e53f

Browse files
committed
Prefix (HTTP_TIMEOUT|USER_AGENT) to DEFAULT_foo
Constants; changing them does nothing.
1 parent 82d6d95 commit d01e53f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bitcoin/rpc.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
from bitcoin.core.script import CScript
3636
from bitcoin.wallet import CBitcoinAddress
3737

38-
USER_AGENT = "AuthServiceProxy/0.1"
38+
DEFAULT_USER_AGENT = "AuthServiceProxy/0.1"
3939

40-
HTTP_TIMEOUT = 30
40+
DEFAULT_HTTP_TIMEOUT = 30
4141

4242
# (un)hexlify to/from unicode, needed for Python3
4343
unhexlify = binascii.unhexlify
@@ -59,7 +59,7 @@ class RawProxy(object):
5959
def __init__(self, service_url=None,
6060
service_port=None,
6161
btc_conf_file=None,
62-
timeout=HTTP_TIMEOUT,
62+
timeout=DEFAULT_HTTP_TIMEOUT,
6363
_connection=None):
6464
"""Low-level JSON-RPC proxy
6565
@@ -137,7 +137,7 @@ def _call(self, service_name, *args):
137137
'id': self.__id_count})
138138
self.__conn.request('POST', self.__url.path, postdata,
139139
{'Host': self.__url.hostname,
140-
'User-Agent': USER_AGENT,
140+
'User-Agent': DEFAULT_USER_AGENT,
141141
'Authorization': self.__auth_header,
142142
'Content-type': 'application/json'})
143143

@@ -169,7 +169,7 @@ def _batch(self, rpc_call_list):
169169
postdata = json.dumps(list(rpc_call_list))
170170
self.__conn.request('POST', self.__url.path, postdata,
171171
{'Host': self.__url.hostname,
172-
'User-Agent': USER_AGENT,
172+
'User-Agent': DEFAULT_USER_AGENT,
173173
'Authorization': self.__auth_header,
174174
'Content-type': 'application/json'})
175175

@@ -189,7 +189,7 @@ class Proxy(RawProxy):
189189
def __init__(self, service_url=None,
190190
service_port=None,
191191
btc_conf_file=None,
192-
timeout=HTTP_TIMEOUT,
192+
timeout=DEFAULT_HTTP_TIMEOUT,
193193
**kwargs):
194194
"""Create a proxy to a bitcoin RPC service
195195

0 commit comments

Comments
 (0)