txcreate, txdo: delay RPC initialization

This commit is contained in:
The MMGen Project 2025-02-15 09:54:19 +00:00
commit 9a963e1488
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
3 changed files with 2 additions and 6 deletions

View file

@ -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),

View file

@ -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),

View file

@ -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,