pubkey should stay as blob

This commit is contained in:
Lex Berezhny 2018-07-15 00:40:46 -04:00
parent fcc7177a9a
commit e36e4c6354
2 changed files with 33 additions and 32 deletions

View file

@ -88,7 +88,7 @@ class BaseDatabase(SQLiteMixin):
account text not null, account text not null,
chain integer not null, chain integer not null,
position integer not null, position integer not null,
pubkey text not null, pubkey blob not null,
history text, history text,
used_times integer not null default 0 used_times integer not null default 0
); );
@ -270,7 +270,7 @@ class BaseDatabase(SQLiteMixin):
values.append(account.public_key.address) values.append(account.public_key.address)
values.append(chain) values.append(chain)
values.append(position) values.append(position)
values.append(pubkey.pubkey_bytes) values.append(sqlite3.Binary(pubkey.pubkey_bytes))
return self.db.runOperation(sql, values) return self.db.runOperation(sql, values)
@staticmethod @staticmethod

View file

@ -269,7 +269,8 @@ class BaseLedger(six.with_metaclass(LedgerRegistry)):
yield lock.acquire() yield lock.acquire()
#try: try:
# see if we have a local copy of transaction, otherwise fetch it from server # see if we have a local copy of transaction, otherwise fetch it from server
raw, local_height, is_verified = yield self.db.get_transaction(hex_id) raw, local_height, is_verified = yield self.db.get_transaction(hex_id)
save_tx = None save_tx = None
@ -296,11 +297,11 @@ class BaseLedger(six.with_metaclass(LedgerRegistry)):
)) ))
self._on_transaction_controller.add(TransactionEvent(address, tx, remote_height, is_verified)) self._on_transaction_controller.add(TransactionEvent(address, tx, remote_height, is_verified))
#except: except:
# log.exception('Failed to synchronize transaction:') log.exception('Failed to synchronize transaction:')
# raise raise
#finally: finally:
lock.release() lock.release()
if not lock.locked: if not lock.locked:
del self._transaction_processing_locks[hex_id] del self._transaction_processing_locks[hex_id]