From 3fcab577eb3295010d99fe48a5799227bdb1bf36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sa=C5=82aban?= Date: Mon, 13 Jun 2022 10:03:01 +0200 Subject: [PATCH] Fix error on missing indices; reformat --- monero/backends/jsonrpc/daemon.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/monero/backends/jsonrpc/daemon.py b/monero/backends/jsonrpc/daemon.py index 886449c..0e93cb6 100755 --- a/monero/backends/jsonrpc/daemon.py +++ b/monero/backends/jsonrpc/daemon.py @@ -1440,8 +1440,8 @@ class JSONRPCDaemon(object): """ if out_peers_arg < 0: - out_peers_arg = 2 ** 32 - 1 - elif out_peers_arg > 2 ** 32 - 1: + out_peers_arg = 2**32 - 1 + elif out_peers_arg > 2**32 - 1: raise ValueError('out_peers_arg "{}" is too large'.format(out_peers_arg)) return self.raw_request("/out_peers", data={"out_peers": int(out_peers_arg)}) @@ -1459,8 +1459,8 @@ class JSONRPCDaemon(object): """ if in_peers_arg < 0: - in_peers_arg = 2 ** 32 - 1 - elif in_peers_arg > 2 ** 32 - 1: + in_peers_arg = 2**32 - 1 + elif in_peers_arg > 2**32 - 1: raise ValueError('in_peers_arg "{}" is too large'.format(in_peers_arg)) return self.raw_request("/in_peers", data={"in_peers": int(in_peers_arg)}) @@ -1598,7 +1598,9 @@ class JSONRPCDaemon(object): timestamp=datetime.fromtimestamp(tx["block_timestamp"]) if "block_timestamp" in tx else None, - output_indices=tx["output_indices"], + output_indices=tx["output_indices"] + if "output_indices" in tx + else None, blob=binascii.unhexlify(tx["as_hex"]) or None, json=as_json, )