Skip to content

Commit bd3607d

Browse files
committed
Fix file location of .cookie when on testnet
1 parent 78aaaf6 commit bd3607d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bitcoin/rpc.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ def __init__(self,
170170
('http', conf['rpchost'], conf['rpcport']))
171171

172172
cookie_dir = conf.get('datadir', os.path.dirname(btc_conf_file))
173-
if bitcoin.params.NAME != "mainnet":
173+
if bitcoin.params.NAME == 'testnet':
174+
cookie_dir = os.path.join(cookie_dir, 'testnet3')
175+
elif bitcoin.params.NAME == 'regtest':
174176
cookie_dir = os.path.join(cookie_dir, bitcoin.params.NAME)
175177
cookie_file = os.path.join(cookie_dir, ".cookie")
176178
try:

0 commit comments

Comments
 (0)