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))
values = []
for position, pubkey in keys:
values.append(pubkey.address)
values.append(account.public_key.address)
values.append(chain)
values.append(position)
values.append(sqlite3.Binary(pubkey.pubkey_bytes))
values.extend([
pubkey.address, account.public_key.address, chain, position,
sqlite3.Binary(pubkey.pubkey_bytes)
])
return self.run_operation(sql, values)
@classmethod