Skip to content

Commit e080ec2

Browse files
committed
look for .cookie file in datadir if specified
1 parent ca1ef88 commit e080ec2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bitcoin/rpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def __init__(self,
162162
service_url = ('%s://%s:%d' %
163163
('http', conf['rpchost'], conf['rpcport']))
164164

165-
cookie_dir = os.path.dirname(btc_conf_file)
165+
cookie_dir = conf.get('datadir', os.path.dirname(btc_conf_file))
166166
if bitcoin.params.NAME != "mainnet":
167167
cookie_dir = os.path.join(cookie_dir, bitcoin.params.NAME)
168168
cookie_file = os.path.join(cookie_dir, ".cookie")

0 commit comments

Comments
 (0)