diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index 2d82490ac..d62cb44a7 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -92,7 +92,7 @@ def maybe_paginate(get_records: Callable, get_record_count: Callable, }) return { "items": (yield get_records(**constraints)), - "total_pages": ((yield get_record_count(**constraints)) + (page_size-1)) / page_size, + "total_pages": int(((yield get_record_count(**constraints)) + (page_size-1)) / page_size), "page": page, "page_size": page_size } return (yield get_records(**constraints)) diff --git a/lbrynet/wallet/database.py b/lbrynet/wallet/database.py index 091e71c04..5ac5f4cfe 100644 --- a/lbrynet/wallet/database.py +++ b/lbrynet/wallet/database.py @@ -22,13 +22,17 @@ class WalletDatabase(BaseDatabase): is_buy boolean not null default 0, is_sell boolean not null default 0 ); + create index txo_claim_id_idx on txo (claim_id); """ CREATE_TABLES_QUERY = ( BaseDatabase.CREATE_TX_TABLE + BaseDatabase.CREATE_PUBKEY_ADDRESS_TABLE + + BaseDatabase.CREATE_PUBKEY_ADDRESS_INDEX + CREATE_TXO_TABLE + - BaseDatabase.CREATE_TXI_TABLE + BaseDatabase.CREATE_TXO_INDEX + + BaseDatabase.CREATE_TXI_TABLE + + BaseDatabase.CREATE_TXI_INDEX ) def txo_to_row(self, tx, address, txo):