From 8f269f155336d443521594ca49a506328b684ff0 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Wed, 28 Jan 2026 12:24:36 +0000 Subject: [PATCH] xmrwallet.ops: `relay` -> `daemon` --- mmgen/xmrwallet/__init__.py | 3 ++- mmgen/xmrwallet/ops/{relay.py => daemon.py} | 16 +++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) rename mmgen/xmrwallet/ops/{relay.py => daemon.py} (88%) diff --git a/mmgen/xmrwallet/__init__.py b/mmgen/xmrwallet/__init__.py index 5dfd66f0..f42e9586 100755 --- a/mmgen/xmrwallet/__init__.py +++ b/mmgen/xmrwallet/__init__.py @@ -55,7 +55,8 @@ op_names = { 'transfer': 'sweep', 'sweep': 'sweep', 'sweep_all': 'sweep', - 'relay': 'relay', + 'daemon': 'daemon', + 'relay': 'daemon', 'txview': 'txview', 'txlist': 'txview', 'label': 'label', diff --git a/mmgen/xmrwallet/ops/relay.py b/mmgen/xmrwallet/ops/daemon.py similarity index 88% rename from mmgen/xmrwallet/ops/relay.py rename to mmgen/xmrwallet/ops/daemon.py index c1872e75..cb3bee2e 100755 --- a/mmgen/xmrwallet/ops/relay.py +++ b/mmgen/xmrwallet/ops/daemon.py @@ -9,7 +9,7 @@ # https://gitlab.com/mmgen/mmgen-wallet """ -xmrwallet.ops.relay: Monero wallet ops for the MMGen Suite +xmrwallet.ops.daemon: Monero wallet ops for the MMGen Suite """ import time @@ -23,7 +23,7 @@ from ..file.tx import MoneroMMGenTX from . import OpBase -class OpRelay(OpBase): +class OpDaemon(OpBase): opts = ('tx_relay_daemon',) def __init__(self, cfg, uarg_tuple): @@ -32,8 +32,6 @@ class OpRelay(OpBase): self.mount_removable_device() - self.tx = MoneroMMGenTX.Signed(self.cfg, Path(self.uargs.infile)) - if self.cfg.tx_relay_daemon: m = self.parse_tx_relay_opt() host, port = m[1].split(':') @@ -42,7 +40,9 @@ class OpRelay(OpBase): else: from ...daemon import CoinDaemon md = CoinDaemon(self.cfg, network_id='xmr', test_suite=self.cfg.test_suite) - host, port = ('localhost', md.rpc_port) + host, port = ( + self.cfg.daemon.split(':') if self.cfg.daemon else + ('localhost', md.rpc_port)) proxy = None self.dc = MoneroRPCClient( @@ -56,6 +56,12 @@ class OpRelay(OpBase): test_connection = host == 'localhost', # avoid extra connections if relay is a public node proxy = proxy) +class OpRelay(OpDaemon): + + def __init__(self, cfg, uarg_tuple): + super().__init__(cfg, uarg_tuple) + self.tx = MoneroMMGenTX.Signed(self.cfg, Path(self.uargs.infile)) + async def main(self): msg('\n' + self.tx.get_info(indent=' '))