mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
Change BCH pidfile name and cli binary.
This commit is contained in:
@@ -126,7 +126,8 @@ class BaseApp:
|
|||||||
def callcoincli(self, coin_type, params, wallet=None, timeout=None):
|
def callcoincli(self, coin_type, params, wallet=None, timeout=None):
|
||||||
bindir = self.coin_clients[coin_type]['bindir']
|
bindir = self.coin_clients[coin_type]['bindir']
|
||||||
datadir = self.coin_clients[coin_type]['datadir']
|
datadir = self.coin_clients[coin_type]['datadir']
|
||||||
command_cli = os.path.join(bindir, chainparams[coin_type]['name'] + '-cli' + ('.exe' if os.name == 'nt' else ''))
|
cli_bin: str = chainparams[coin_type].get('cli_binname', chainparams[coin_type]['name'] + '-cli')
|
||||||
|
command_cli = os.path.join(bindir, cli_bin + ('.exe' if os.name == 'nt' else ''))
|
||||||
args = [command_cli, ]
|
args = [command_cli, ]
|
||||||
if self.chain != 'mainnet':
|
if self.chain != 'mainnet':
|
||||||
args.append('-' + self.chain)
|
args.append('-' + self.chain)
|
||||||
|
|||||||
@@ -756,7 +756,7 @@ class BasicSwap(BaseApp):
|
|||||||
authcookiepath = os.path.join(self.getChainDatadirPath(coin), '.cookie')
|
authcookiepath = os.path.join(self.getChainDatadirPath(coin), '.cookie')
|
||||||
|
|
||||||
pidfilename = cc['name']
|
pidfilename = cc['name']
|
||||||
if cc['name'] in ('bitcoin', 'litecoin', 'namecoin', 'dash', 'firo'):
|
if cc['name'] in ('bitcoin', 'litecoin', 'namecoin', 'dash', 'firo', 'bitcoincash'):
|
||||||
pidfilename += 'd'
|
pidfilename += 'd'
|
||||||
|
|
||||||
pidfilepath = os.path.join(self.getChainDatadirPath(coin), pidfilename + '.pid')
|
pidfilepath = os.path.join(self.getChainDatadirPath(coin), pidfilename + '.pid')
|
||||||
|
|||||||
@@ -930,7 +930,6 @@ def prepareDataDir(coin, settings, chain, particl_mnemonic, extra_opts={}):
|
|||||||
for opt_line in wownerod_proxy_config:
|
for opt_line in wownerod_proxy_config:
|
||||||
fp.write(opt_line + '\n')
|
fp.write(opt_line + '\n')
|
||||||
|
|
||||||
if coin in ('wownero', 'monero'):
|
|
||||||
wallets_dir = core_settings.get('walletsdir', data_dir)
|
wallets_dir = core_settings.get('walletsdir', data_dir)
|
||||||
if not os.path.exists(wallets_dir):
|
if not os.path.exists(wallets_dir):
|
||||||
os.makedirs(wallets_dir)
|
os.makedirs(wallets_dir)
|
||||||
@@ -1002,7 +1001,8 @@ def prepareDataDir(coin, settings, chain, particl_mnemonic, extra_opts={}):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
core_conf_path = os.path.join(data_dir, coin + '.conf')
|
core_conf_name: str = 'bitcoin.conf' if coin == 'bitcoincash' else coin + '.conf'
|
||||||
|
core_conf_path: str = os.path.join(data_dir, core_conf_name)
|
||||||
if os.path.exists(core_conf_path):
|
if os.path.exists(core_conf_path):
|
||||||
exitWithError('{} exists'.format(core_conf_path))
|
exitWithError('{} exists'.format(core_conf_path))
|
||||||
with open(core_conf_path, 'w') as fp:
|
with open(core_conf_path, 'w') as fp:
|
||||||
@@ -1056,7 +1056,8 @@ def prepareDataDir(coin, settings, chain, particl_mnemonic, extra_opts={}):
|
|||||||
if BTC_RPC_USER != '':
|
if BTC_RPC_USER != '':
|
||||||
fp.write('rpcauth={}:{}${}\n'.format(BTC_RPC_USER, salt, password_to_hmac(salt, BTC_RPC_PWD)))
|
fp.write('rpcauth={}:{}${}\n'.format(BTC_RPC_USER, salt, password_to_hmac(salt, BTC_RPC_PWD)))
|
||||||
elif coin == 'bitcoincash':
|
elif coin == 'bitcoincash':
|
||||||
fp.write('prune=2000\n')
|
fp.write('prune=4000\n')
|
||||||
|
fp.write('pid=bitcoincashd.pid\n')
|
||||||
if BCH_RPC_USER != '':
|
if BCH_RPC_USER != '':
|
||||||
fp.write('rpcauth={}:{}${}\n'.format(BCH_RPC_USER, salt, password_to_hmac(salt, BCH_RPC_PWD)))
|
fp.write('rpcauth={}:{}${}\n'.format(BCH_RPC_USER, salt, password_to_hmac(salt, BCH_RPC_PWD)))
|
||||||
elif coin == 'namecoin':
|
elif coin == 'namecoin':
|
||||||
|
|||||||
@@ -443,6 +443,7 @@ chainparams = {
|
|||||||
'has_cltv': True,
|
'has_cltv': True,
|
||||||
'has_csv': True,
|
'has_csv': True,
|
||||||
'has_segwit': False,
|
'has_segwit': False,
|
||||||
|
'cli_binname' : 'bitcoin-cli',
|
||||||
'mainnet': {
|
'mainnet': {
|
||||||
'rpcport': 8332,
|
'rpcport': 8332,
|
||||||
'pubkey_address': 0,
|
'pubkey_address': 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user