simplify bind statement

This commit is contained in:
Victor Shyba 2018-11-07 12:59:03 -03:00 committed by Lex Berezhny
parent 3cb4012dbf
commit daecc582f3

View file

@ -893,6 +893,6 @@ def _format_claim_response(outpoint, claim_id, name, amount, height, serialized,
def _batched_select(transaction, query, parameters):
for start_index in range(0, len(parameters), 900):
current_batch = parameters[start_index:start_index+900]
bind = "({})".format(','.join('?' for _ in range(len(current_batch))))
bind = "({})".format(','.join(['?'] * len(current_batch)))
for result in transaction.execute(query.format(bind), current_batch):
yield result