xmrwallet.ops: relay -> daemon
This commit is contained in:
parent
e865170484
commit
8f269f1553
2 changed files with 13 additions and 6 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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=' '))
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue