addrimport: remove segwit_is_active requirement

This commit is contained in:
The MMGen Project 2024-12-30 11:31:39 +00:00
commit 5e4d5952be
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 2 additions and 6 deletions

View file

@ -172,7 +172,7 @@ class CoinAddr(HiliteStr, InitErrors, MMGenObject):
me.proto = proto
return me
except Exception as e:
return cls.init_fail(e, addr, objname=f'{proto.cls_name} address')
return cls.init_fail(e, addr, objname=f'{proto.name} {proto.cls_name} address')
@property
def parsed(self):

View file

@ -84,11 +84,7 @@ addrimport_msgs = {
def parse_cmd_args(rpc, cmd_args):
def import_mmgen_list(infile):
al = (AddrList, KeyAddrList)[bool(cfg.keyaddr_file)](cfg, proto, infile)
if al.al_id.mmtype in ('S', 'B'):
if not rpc.info('segwit_is_active'):
die(2, 'Segwit is not active on this chain. Cannot import Segwit addresses')
return al
return (AddrList, KeyAddrList)[bool(cfg.keyaddr_file)](cfg, proto, infile)
if len(cmd_args) == 1:
infile = cmd_args[0]