Add defaults and fix ranges in height query
This commit is contained in:
parent
68e631ebe3
commit
6a5dc9ad6d
|
@ -187,14 +187,18 @@ class JSONRPCWallet(object):
|
||||||
if method == 'get_transfers':
|
if method == 'get_transfers':
|
||||||
arg = 'in'
|
arg = 'in'
|
||||||
if pmtfilter.min_height:
|
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
|
params['filter_by_height'] = True
|
||||||
if pmtfilter.max_height:
|
if pmtfilter.max_height:
|
||||||
params['max_height'] = pmtfilter.max_height
|
params['max_height'] = pmtfilter.max_height
|
||||||
params['filter_by_height'] = True
|
params['filter_by_height'] = True
|
||||||
|
# PR#3235 makes the following obsolete
|
||||||
|
params['max_height'] = params.get('max_height', 2**64-1)
|
||||||
else:
|
else:
|
||||||
arg = 'payments'
|
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 = self.raw_request(method, params)
|
||||||
pmts = _pmts.get(arg, [])
|
pmts = _pmts.get(arg, [])
|
||||||
if pmtfilter.unconfirmed:
|
if pmtfilter.unconfirmed:
|
||||||
|
|
Loading…
Reference in New Issue