diff --git a/basicswap/templates/offer.html b/basicswap/templates/offer.html index f6c1bac..21a1e7a 100644 --- a/basicswap/templates/offer.html +++ b/basicswap/templates/offer.html @@ -19,7 +19,7 @@ Coin To{{ data.coin_to }} Amount From{{ data.amt_from }} {{ data.tla_from }} Amount To{{ data.amt_to }} {{ data.tla_to }} -Rate{{ data.rate }} {{ data.amt_from }}/{{ data.tla_from }} +Rate{{ data.rate }} Amount Variable{{ data.amount_negotiable }} Rate Variable{{ data.rate_negotiable }} Script Lock Type{{ data.lock_type }} diff --git a/bin/basicswap_prepare.py b/bin/basicswap_prepare.py index 46ed017..03dfbd5 100755 --- a/bin/basicswap_prepare.py +++ b/bin/basicswap_prepare.py @@ -350,7 +350,7 @@ def prepareDataDir(coin, settings, chain, particl_mnemonic): if os.path.exists(wallet_conf_path): exitWithError('{} exists'.format(wallet_conf_path)) with open(wallet_conf_path, 'w') as fp: - fp.write('daemon-address={}:{}\n'.format(core_settings['rpchost'], core_settings['rpcport'])) + fp.write('untrusted-daemon=1\n') fp.write('no-dns=1\n') fp.write('rpc-bind-port={}\n'.format(core_settings['walletrpcport'])) fp.write('rpc-bind-ip={}\n'.format(COINS_BIND_IP)) diff --git a/bin/basicswap_run.py b/bin/basicswap_run.py index 6d346c6..40d71ef 100755 --- a/bin/basicswap_run.py +++ b/bin/basicswap_run.py @@ -9,6 +9,7 @@ import os import sys import json import time +import shutil import signal import logging import traceback @@ -60,9 +61,29 @@ def startXmrWalletDaemon(node_dir, bin_dir, wallet_bin, opts=[]): daemon_bin = os.path.expanduser(os.path.join(bin_dir, wallet_bin)) data_dir = os.path.expanduser(node_dir) - args = [daemon_bin, '--non-interactive', '--config-file=' + os.path.join(data_dir, 'monero_wallet.conf')] + opts + config_path = os.path.join(data_dir, 'monero_wallet.conf') + args = [daemon_bin, '--non-interactive', '--config-file=' + config_path] + opts + + # TODO: Remove + # Remove daemon-address + has_daemon_address = False + has_untrusted = False + with open(config_path) as fp: + for line in fp: + if line.startswith('daemon-address'): + has_daemon_address = True + if line.startswith('untrusted-daemon'): + has_untrusted = True + if has_daemon_address: + logging.info('Rewriting monero_wallet.conf') + shutil.copyfile(config_path, config_path + '.last') + with open(config_path + '.last') as fp_from, open(config_path, 'w') as fp_to: + for line in fp_from: + if not line.startswith('daemon-address'): + fp_to.write(line) + if not has_untrusted: + fp_to.write('untrusted-daemon=1\n') - args += opts logging.info('Starting wallet daemon {} --wallet-dir={}'.format(daemon_bin, node_dir)) # TODO: return subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=data_dir) @@ -109,7 +130,10 @@ def runClient(fp, data_dir, chain): if v['manage_wallet_daemon'] is True: logger.info('Starting {} wallet daemon'.format(c.capitalize())) - daemons.append(startXmrWalletDaemon(v['datadir'], v['bindir'], 'monero-wallet-rpc')) + daemon_addr = '{}:{}'.format(v['rpchost'], v['rpcport']) + logger.info('daemon-address: {}'.format(daemon_addr)) + opts = ['--daemon-address', daemon_addr, ] + daemons.append(startXmrWalletDaemon(v['datadir'], v['bindir'], 'monero-wallet-rpc', opts)) pid = daemons[-1].pid logger.info('Started {} {}'.format('monero-wallet-rpc', pid))