diff --git a/server/block_processor.py b/server/block_processor.py index 6c9483f..3887204 100644 --- a/server/block_processor.py +++ b/server/block_processor.py @@ -767,7 +767,8 @@ class BlockProcessor(LoggedClass): '''Returns the hash168 for a UTXO.''' hash168 = None if 0 <= index <= 65535: - hash168 = self.utxo_cache(tx_hash, struct.pack('= 0: - return param + try: + param = int(param) + except ValueError: + pass + else: + if param >= 0: + return param + raise RPCError('param should be a non-negative integer: {}' .format(param))