From 9a963e14888b3635557ce915b7ee2e14c5ae87be Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sat, 15 Feb 2025 09:54:19 +0000 Subject: [PATCH] txcreate, txdo: delay RPC initialization --- mmgen/main_txcreate.py | 3 --- mmgen/main_txdo.py | 3 --- mmgen/tx/new.py | 2 ++ 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/mmgen/main_txcreate.py b/mmgen/main_txcreate.py index 8f597ae8..431903c7 100755 --- a/mmgen/main_txcreate.py +++ b/mmgen/main_txcreate.py @@ -112,9 +112,6 @@ async def main(): from .tx import NewTX tx1 = await NewTX(cfg=cfg, proto=cfg._proto, target=target) - from .rpc import rpc_init - tx1.rpc = await rpc_init(cfg) - tx2 = await tx1.create( cmd_args = cfg._args, locktime = int(cfg.locktime or 0), diff --git a/mmgen/main_txdo.py b/mmgen/main_txdo.py index e0f78c7c..5ceb7af1 100755 --- a/mmgen/main_txdo.py +++ b/mmgen/main_txdo.py @@ -153,9 +153,6 @@ async def main(): tx1 = await NewTX(cfg=cfg, proto=cfg._proto, target=target) - from .rpc import rpc_init - tx1.rpc = await rpc_init(cfg) - tx2 = await tx1.create( cmd_args = cfg._args, locktime = int(cfg.locktime or 0), diff --git a/mmgen/tx/new.py b/mmgen/tx/new.py index f396760e..6b3a8ef1 100755 --- a/mmgen/tx/new.py +++ b/mmgen/tx/new.py @@ -418,6 +418,8 @@ class New(Base): if self.target == 'swaptx': # updates self.proto! self.proto, cmd_args = await self.process_swap_cmdline_args(cmd_args, addrfile_args) + from ..rpc import rpc_init + self.rpc = await rpc_init(self.cfg, self.proto) from ..addrdata import TwAddrData await self.process_cmdline_args( cmd_args,