forked from LBRYCommunity/lbry-sdk
simplify add_keys
This commit is contained in:
parent
19e326c140
commit
45669dad33
1 changed files with 5 additions and 5 deletions
|
@ -489,12 +489,12 @@ class BaseDatabase(SQLiteMixin):
|
|||
return addresses[0]
|
||||
|
||||
async def add_keys(self, account, chain, keys):
|
||||
sql = "insert into pubkey_address (address, account, chain, position, pubkey) values (?, ?, ?, ?, ?)"
|
||||
values = (
|
||||
(pubkey.address, account.public_key.address, chain, position, sqlite3.Binary(pubkey.pubkey_bytes))
|
||||
for position, pubkey in keys
|
||||
await self.db.executemany(
|
||||
"insert into pubkey_address (address, account, chain, position, pubkey) values (?, ?, ?, ?, ?)",
|
||||
((pubkey.address, account.public_key.address, chain,
|
||||
position, sqlite3.Binary(pubkey.pubkey_bytes))
|
||||
for position, pubkey in keys)
|
||||
)
|
||||
await self.db.executemany(sql, values)
|
||||
|
||||
async def _set_address_history(self, address, history):
|
||||
await self.db.execute(
|
||||
|
|
Loading…
Reference in a new issue