From 5cd7e9a9b8c479ba06ec80e6df36cc10813adf97 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 21 Mar 2020 15:08:14 -0400 Subject: [PATCH] increment scema version and force specific indexes to be used for get_txos() --- lbry/wallet/database.py | 6 +++--- lbry/wallet/ledger.py | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lbry/wallet/database.py b/lbry/wallet/database.py index 571335fee..abae15d07 100644 --- a/lbry/wallet/database.py +++ b/lbry/wallet/database.py @@ -387,7 +387,7 @@ def dict_row_factory(cursor, row): class Database(SQLiteMixin): - SCHEMA_VERSION = "1.1" + SCHEMA_VERSION = "1.2" PRAGMAS = """ pragma journal_mode=WAL; @@ -633,7 +633,7 @@ class Database(SQLiteMixin): txo.id: txo for txo in (await self.get_txos( wallet=wallet, - txid__in=txids[offset:offset+step], + txid__in=txids[offset:offset+step], order_by='txo.txid', include_is_spent=include_is_spent, include_is_my_input=include_is_my_input, include_is_my_output=include_is_my_output, @@ -646,7 +646,7 @@ class Database(SQLiteMixin): txo.id: txo for txo in (await self.get_txos( wallet=wallet, - txoid__in=txi_txoids[offset:offset+step], + txoid__in=txi_txoids[offset:offset+step], order_by='txo.txoid', include_is_my_output=include_is_my_output, )) }) diff --git a/lbry/wallet/ledger.py b/lbry/wallet/ledger.py index 7b8eefdab..639446d3f 100644 --- a/lbry/wallet/ledger.py +++ b/lbry/wallet/ledger.py @@ -524,7 +524,9 @@ class Ledger(metaclass=LedgerRegistry): check_db_for_txos.append(txi.txo_ref.id) referenced_txos = {} if not check_db_for_txos else { - txo.id: txo for txo in await self.db.get_txos(txoid__in=check_db_for_txos, no_tx=True) + txo.id: txo for txo in await self.db.get_txos( + txoid__in=check_db_for_txos, order_by='txo.txoid', no_tx=True + ) } for txi in tx.inputs: