From fef1d509a57eabe1a3153b294f1f461c25269f84 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Thu, 25 Feb 2021 16:06:56 +0300 Subject: [PATCH] override_globals_from_cfg_file(): set class, not instance, attr in proto Fixes a critical bug that led to coin-specific vars in cfg file being ignored. --- mmgen/opts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmgen/opts.py b/mmgen/opts.py index 87ec309e..581dc766 100755 --- a/mmgen/opts.py +++ b/mmgen/opts.py @@ -130,10 +130,10 @@ def override_globals_from_cfg_file(ucfg): ns = d.name.split('_') if ns[0] in CoinProtocol.coins: nse,tn = (ns[2:],True) if len(ns) > 2 and ns[1] == 'testnet' else (ns[1:],False) - cls = init_proto(ns[0],tn) + cls = type(init_proto(ns[0],tn)) # no instance yet, so override _class_ attr attr = '_'.join(nse) else: - cls = g + cls = g # g is "singleton" instance, so override _instance_ attr attr = d.name refval = getattr(cls,attr) if type(refval) is dict and type(val) is str: # hack - catch single colon-separated value