File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,14 @@ class InWarmupError(JSONRPCError):
128
128
RPC_ERROR_CODE = - 28
129
129
130
130
131
+ def default_btc_dir ():
132
+ if platform .system () == 'Darwin' :
133
+ return os .path .expanduser ('~/Library/Application Support/Bitcoin/' )
134
+ elif platform .system () == 'Windows' :
135
+ return os .path .join (os .environ ['APPDATA' ], 'Bitcoin' )
136
+ return os .path .expanduser ('~/.bitcoin' )
137
+
138
+
131
139
class BaseProxy (object ):
132
140
"""Base JSON-RPC proxy class. Contains only private methods; do not use
133
141
directly."""
@@ -148,13 +156,7 @@ def __init__(self,
148
156
if service_url is None :
149
157
# Figure out the path to the bitcoin.conf file
150
158
if btc_conf_file is None :
151
- if platform .system () == 'Darwin' :
152
- btc_conf_file = os .path .expanduser ('~/Library/Application Support/Bitcoin/' )
153
- elif platform .system () == 'Windows' :
154
- btc_conf_file = os .path .join (os .environ ['APPDATA' ], 'Bitcoin' )
155
- else :
156
- btc_conf_file = os .path .expanduser ('~/.bitcoin' )
157
- btc_conf_file = os .path .join (btc_conf_file , 'bitcoin.conf' )
159
+ btc_conf_file = os .path .join (default_btc_dir (), 'bitcoin.conf' )
158
160
159
161
# Bitcoin Core accepts empty rpcuser, not specified in btc_conf_file
160
162
conf = {'rpcuser' : "" }
You can’t perform that action at this time.
0 commit comments