From 857a2b9dcaf64d4298027644f8e6716fa22db941 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 11 May 2020 21:47:35 +0530 Subject: perf: reserve history in separate object store --- src/operations/history.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/operations/history.ts') diff --git a/src/operations/history.ts b/src/operations/history.ts index 669a6cf85..1271c56ef 100644 --- a/src/operations/history.ts +++ b/src/operations/history.ts @@ -172,6 +172,7 @@ export async function getHistory( Stores.purchases, Stores.refreshGroups, Stores.reserves, + Stores.reserveHistory, Stores.tips, Stores.withdrawalGroups, Stores.payEvents, @@ -384,8 +385,12 @@ export async function getHistory( type: ReserveType.Manual, }; } + const hist = await tx.get(Stores.reserveHistory, reserve.reservePub); + if (!hist) { + throw Error("inconsistent database"); + } const s = summarizeReserveHistory( - reserve.reserveTransactions, + hist.reserveTransactions, reserve.currency, ); history.push({ -- cgit v1.2.3