Minor fixes, cleanups
This commit is contained in:
parent
3cfcd45d59
commit
a201aeae94
4 changed files with 21 additions and 23 deletions
|
|
@ -290,21 +290,17 @@ class AddrListIDStr(unicode,Hilite):
|
|||
color = 'green'
|
||||
trunc_ok = False
|
||||
def __new__(cls,addrlist,fmt_str=None):
|
||||
try: int(addrlist.data[0].idx)
|
||||
except:
|
||||
s = '(no idxs)'
|
||||
else:
|
||||
idxs = [e.idx for e in addrlist.data]
|
||||
prev = idxs[0]
|
||||
ret = prev,
|
||||
for i in idxs[1:]:
|
||||
if i == prev + 1:
|
||||
if i == idxs[-1]: ret += '-', i
|
||||
else:
|
||||
if prev != ret[-1]: ret += '-', prev
|
||||
ret += ',', i
|
||||
prev = i
|
||||
s = ''.join([unicode(i) for i in ret])
|
||||
idxs = [e.idx for e in addrlist.data]
|
||||
prev = idxs[0]
|
||||
ret = prev,
|
||||
for i in idxs[1:]:
|
||||
if i == prev + 1:
|
||||
if i == idxs[-1]: ret += '-', i
|
||||
else:
|
||||
if prev != ret[-1]: ret += '-', prev
|
||||
ret += ',', i
|
||||
prev = i
|
||||
s = ''.join(map(unicode,ret))
|
||||
|
||||
if fmt_str:
|
||||
ret = fmt_str.format(s)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,9 @@ common_args = lambda: (
|
|||
|
||||
def start_daemon(user,quiet=False,daemon=True,reindex=False):
|
||||
# requires Bitcoin ABC version >= 0.16.2
|
||||
add_args = ((),('--usecashaddr=0',))[g.proto.daemon_name=='bitcoind-abc']
|
||||
add_args = ()
|
||||
if g.proto.daemon_name == 'bitcoind-abc': add_args = ('--usecashaddr=0',)
|
||||
elif g.proto.daemon_name == 'litecoind': add_args = ('--mempoolreplacement=1',)
|
||||
cmd = (
|
||||
g.proto.daemon_name,
|
||||
'--listen=0',
|
||||
|
|
|
|||
|
|
@ -794,10 +794,9 @@ def do_license_msg(immed=False):
|
|||
def get_daemon_cfg_options(cfg_keys):
|
||||
cfg_file = os.path.join(g.proto.daemon_data_dir,g.proto.name+'.conf')
|
||||
try:
|
||||
cfg = dict([(k,v) for k,v in [
|
||||
split2(str(line).translate(None,'\t '),'=')
|
||||
for line in get_lines_from_file(cfg_file,'',silent=bool(opt.quiet))
|
||||
] if k in cfg_keys])
|
||||
lines = get_lines_from_file(cfg_file,'',silent=bool(opt.quiet))
|
||||
kv_pairs = [split2(str(line).translate(None,'\t '),'=') for line in lines]
|
||||
cfg = dict([(k,v) for k,v in kv_pairs if k in cfg_keys])
|
||||
except:
|
||||
vmsg("Warning: '{}' does not exist or is unreadable".format(cfg_file))
|
||||
cfg = {}
|
||||
|
|
|
|||
|
|
@ -266,9 +266,9 @@ f_b2x_rt='Regtest (Bob and Alice) mode tests for B2X completed'
|
|||
i_ltc='Litecoin'
|
||||
s_ltc='The litecoin daemon must both be running for the following tests'
|
||||
t_ltc=(
|
||||
"$test_py --coin=ltc -On dfl_wallet main"
|
||||
"$test_py --coin=ltc --segwit -On dfl_wallet main"
|
||||
"$test_py --coin=ltc --segwit-random -On dfl_wallet main"
|
||||
"$test_py --coin=ltc -On dfl_wallet main ref ref_other"
|
||||
"$test_py --coin=ltc -On --segwit dfl_wallet main ref ref_other"
|
||||
"$test_py --coin=ltc -On --segwit-random dfl_wallet main"
|
||||
"$tooltest_py --coin=ltc rpc"
|
||||
)
|
||||
f_ltc='You may stop the litecoin daemon if you wish'
|
||||
|
|
@ -362,6 +362,7 @@ tests=$dfl_tests
|
|||
|
||||
check_args
|
||||
|
||||
echo "Running tests: $tests"
|
||||
run_tests "$tests"
|
||||
rm -rf /tmp/mmgen-test-release-*
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue