diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-05-11 21:47:35 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-05-11 21:47:35 +0530 |
commit | 857a2b9dcaf64d4298027644f8e6716fa22db941 (patch) | |
tree | dc711c998d153a5f3169e71c851adbf5d7ad12ec /src/operations/history.ts | |
parent | 277a513a8f9c46392446514e7a37e77e4f4b5327 (diff) | |
download | wallet-core-857a2b9dcaf64d4298027644f8e6716fa22db941.tar.xz |
perf: reserve history in separate object store
Diffstat (limited to 'src/operations/history.ts')
-rw-r--r-- | src/operations/history.ts | 7 |
1 files changed, 6 insertions, 1 deletions
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({ |