From 8543e477d98f376dc8b49d43bc5e765a6ea3a49e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Gasser?= Date: Fri, 27 Nov 2020 15:13:02 -0500 Subject: [PATCH] don't do an extra call --- backend/substrapp/ledger/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/substrapp/ledger/api.py b/backend/substrapp/ledger/api.py index c6f88a98e..70560456b 100644 --- a/backend/substrapp/ledger/api.py +++ b/backend/substrapp/ledger/api.py @@ -172,8 +172,8 @@ def call_ledger(channel_name, call_type, fcn, *args, **kwargs): if isinstance(response, dict) and 'bookmarks' in response: results = response['results'] # first results - while response['results']: - kwargs['args'] = {'bookmarks': response['bookmarks']} + while response['results'] and len(response['bookmark']) > 0: + kwargs['args'] = {'bookmark': response['bookmark']} response = _call_ledger(channel_name, call_type, fcn, *args, **kwargs) results.extend(response['results']) # following results else: