From 6a5dc9ad6d6b241e6e98624e01959f642df8d9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sa=C5=82aban?= Date: Mon, 5 Feb 2018 18:15:06 +0100 Subject: [PATCH] Add defaults and fix ranges in height query --- monero/backends/jsonrpc.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/monero/backends/jsonrpc.py b/monero/backends/jsonrpc.py index e98a7d2..3657f57 100644 --- a/monero/backends/jsonrpc.py +++ b/monero/backends/jsonrpc.py @@ -187,14 +187,18 @@ class JSONRPCWallet(object): if method == 'get_transfers': arg = 'in' if pmtfilter.min_height: - params['min_height'] = pmtfilter.min_height + # NOTE: the API uses (min, max] range which is confusing + params['min_height'] = pmtfilter.min_height - 1 params['filter_by_height'] = True if pmtfilter.max_height: params['max_height'] = pmtfilter.max_height params['filter_by_height'] = True + # PR#3235 makes the following obsolete + params['max_height'] = params.get('max_height', 2**64-1) else: arg = 'payments' - params['min_block_height'] = pmtfilter.min_height or 0 + # NOTE: the API uses (min, max] range which is confusing + params['min_block_height'] = (pmtfilter.min_height or 1) - 1 _pmts = self.raw_request(method, params) pmts = _pmts.get(arg, []) if pmtfilter.unconfirmed: