|
@@ -9,7 +9,7 @@
|
|
|
# https://gitlab.com/mmgen/mmgen-wallet
|
|
# 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
|
|
import time
|
|
@@ -23,7 +23,7 @@ from ..file.tx import MoneroMMGenTX
|
|
|
|
|
|
|
|
from . import OpBase
|
|
from . import OpBase
|
|
|
|
|
|
|
|
-class OpRelay(OpBase):
|
|
|
|
|
|
|
+class OpDaemon(OpBase):
|
|
|
opts = ('tx_relay_daemon',)
|
|
opts = ('tx_relay_daemon',)
|
|
|
|
|
|
|
|
def __init__(self, cfg, uarg_tuple):
|
|
def __init__(self, cfg, uarg_tuple):
|
|
@@ -32,8 +32,6 @@ class OpRelay(OpBase):
|
|
|
|
|
|
|
|
self.mount_removable_device()
|
|
self.mount_removable_device()
|
|
|
|
|
|
|
|
- self.tx = MoneroMMGenTX.Signed(self.cfg, Path(self.uargs.infile))
|
|
|
|
|
-
|
|
|
|
|
if self.cfg.tx_relay_daemon:
|
|
if self.cfg.tx_relay_daemon:
|
|
|
m = self.parse_tx_relay_opt()
|
|
m = self.parse_tx_relay_opt()
|
|
|
host, port = m[1].split(':')
|
|
host, port = m[1].split(':')
|
|
@@ -42,7 +40,9 @@ class OpRelay(OpBase):
|
|
|
else:
|
|
else:
|
|
|
from ...daemon import CoinDaemon
|
|
from ...daemon import CoinDaemon
|
|
|
md = CoinDaemon(self.cfg, network_id='xmr', test_suite=self.cfg.test_suite)
|
|
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
|
|
proxy = None
|
|
|
|
|
|
|
|
self.dc = MoneroRPCClient(
|
|
self.dc = MoneroRPCClient(
|
|
@@ -56,6 +56,12 @@ class OpRelay(OpBase):
|
|
|
test_connection = host == 'localhost', # avoid extra connections if relay is a public node
|
|
test_connection = host == 'localhost', # avoid extra connections if relay is a public node
|
|
|
proxy = proxy)
|
|
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):
|
|
async def main(self):
|
|
|
msg('\n' + self.tx.get_info(indent=' '))
|
|
msg('\n' + self.tx.get_info(indent=' '))
|
|
|
|
|
|