Fix rpc console in http mode.

This commit is contained in:
tecnovert
2023-08-12 00:01:04 +02:00
parent 5c23983c8e
commit 45e49848b1
2 changed files with 6 additions and 3 deletions

View File

@@ -308,7 +308,10 @@ class HttpHandler(BaseHTTPRequestHandler):
else:
if call_type == 'http':
method, params = parse_cmd(cmd, type_map)
result = cmd + '\n' + swap_client.ci(coin_type).rpc_callback(method, params)
rv = swap_client.ci(coin_type).rpc_callback(method, params)
if not isinstance(rv, str):
rv = json.dumps(rv, indent=4)
result = cmd + '\n' + rv
else:
result = cmd + '\n' + swap_client.callcoincli(coin_type, cmd)
except Exception as ex: