optimize insert key loop

This commit is contained in:
Victor Shyba 2018-10-10 17:24:24 -03:00 committed by Lex Berezhny
parent 87c210952b
commit 6bdd9c9d78

View file

@ -480,11 +480,10 @@ class BaseDatabase(SQLiteMixin):
) + ', '.join(['(?, ?, ?, ?, ?)'] * len(keys)) ) + ', '.join(['(?, ?, ?, ?, ?)'] * len(keys))
values = [] values = []
for position, pubkey in keys: for position, pubkey in keys:
values.append(pubkey.address) values.extend([
values.append(account.public_key.address) pubkey.address, account.public_key.address, chain, position,
values.append(chain) sqlite3.Binary(pubkey.pubkey_bytes)
values.append(position) ])
values.append(sqlite3.Binary(pubkey.pubkey_bytes))
return self.run_operation(sql, values) return self.run_operation(sql, values)
@classmethod @classmethod