From d96011742bcee0f88678f2158195eaa479f295e7 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Mon, 1 Jun 2020 20:29:58 +0000 Subject: [PATCH] modified: mmnode-blocks-info modified: mmnode-netrate modified: mmnode-peerblocks --- mmnode-blocks-info | 6 +++++- mmnode-netrate | 8 ++++++-- mmnode-peerblocks | 7 +++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/mmnode-blocks-info b/mmnode-blocks-info index b7833a5..aeb925a 100755 --- a/mmnode-blocks-info +++ b/mmnode-blocks-info @@ -311,9 +311,13 @@ if len(cmd_args) not in (0,1): opts.usage() async def main(): + + from mmgen.protocol import init_proto_from_opts + proto = init_proto_from_opts() + from mmgen.rpc import rpc_init global c - c = await rpc_init() + c = await rpc_init(proto) if opt.transaction: m = BlocksInfoTxFind() diff --git a/mmnode-netrate b/mmnode-netrate index a21d7a7..8e436da 100755 --- a/mmnode-netrate +++ b/mmnode-netrate @@ -39,8 +39,12 @@ cmd_args = opts.init(opts_data) ERASE_LINE,CUR_UP = '\033[K','\033[1A' async def main(): + + from mmgen.protocol import init_proto_from_opts + proto = init_proto_from_opts() + from mmgen.rpc import rpc_init - c = await rpc_init() + c = await rpc_init(proto) async def get_data(): d = await c.call('getnettotals') @@ -64,6 +68,6 @@ async def main(): rs,ss,ts = r,s,t try: - run_session(main(),do_rpc_init=False) + run_session(main()) except KeyboardInterrupt: sys.stderr.write('\n') diff --git a/mmnode-peerblocks b/mmnode-peerblocks index 0c43000..54496ca 100755 --- a/mmnode-peerblocks +++ b/mmnode-peerblocks @@ -150,8 +150,11 @@ async def main(): msg_r(CUR_HOME+ERASE_ALL) + from mmgen.protocol import init_proto_from_opts + proto = init_proto_from_opts() + from mmgen.rpc import rpc_init - rpc = await rpc_init() + rpc = await rpc_init(proto) while True: await do_inflight(rpc) @@ -168,7 +171,7 @@ ERASE_ALL,ERASE_LINE,CUR_HOME,CUR_HIDE,CUR_SHOW = ( '\033[J','\033[K','\033[H','\033[?25l','\033[?25h') try: - run_session(main(),do_rpc_init=False) + run_session(main()) except: from subprocess import run run(['stty','sane'])