summaryrefslogtreecommitdiff
path: root/src/operations/history.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-05-11 21:47:35 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-05-11 21:47:35 +0530
commit857a2b9dcaf64d4298027644f8e6716fa22db941 (patch)
treedc711c998d153a5f3169e71c851adbf5d7ad12ec /src/operations/history.ts
parent277a513a8f9c46392446514e7a37e77e4f4b5327 (diff)
downloadwallet-core-857a2b9dcaf64d4298027644f8e6716fa22db941.tar.gz
wallet-core-857a2b9dcaf64d4298027644f8e6716fa22db941.tar.bz2
wallet-core-857a2b9dcaf64d4298027644f8e6716fa22db941.zip
perf: reserve history in separate object store
Diffstat (limited to 'src/operations/history.ts')
-rw-r--r--src/operations/history.ts7
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({