aboutsummaryrefslogtreecommitdiff
path: root/src/wallet-impl/reserves.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-12-03 01:33:25 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-12-03 01:36:06 +0100
commit8683c93613caa4047c4fd874aefb0b7d35fdc038 (patch)
treed8cbdab473e9f53119db4590f6543a5f0f8a39f8 /src/wallet-impl/reserves.ts
parentc33dd75711a39403bd4dd9940caab6d5e6ad2d77 (diff)
downloadwallet-core-8683c93613caa4047c4fd874aefb0b7d35fdc038.tar.xz
version bump / pending balance tweaks
Diffstat (limited to 'src/wallet-impl/reserves.ts')
-rw-r--r--src/wallet-impl/reserves.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/wallet-impl/reserves.ts b/src/wallet-impl/reserves.ts
index c9cd10ca2..d70f02576 100644
--- a/src/wallet-impl/reserves.ts
+++ b/src/wallet-impl/reserves.ts
@@ -502,6 +502,8 @@ async function depleteReserve(
const withdrawalSessionId = encodeCrock(randomBytes(32));
+ const totalCoinValue = Amounts.sum(denomsForWithdraw.map(x => x.value)).amount;
+
const withdrawalRecord: WithdrawalSessionRecord = {
withdrawSessionId: withdrawalSessionId,
exchangeBaseUrl: reserve.exchangeBaseUrl,
@@ -509,15 +511,14 @@ async function depleteReserve(
type: "reserve",
reservePub: reserve.reservePub,
},
- withdrawalAmount: Amounts.toString(withdrawAmount),
+ rawWithdrawalAmount: withdrawAmount,
startTimestamp: getTimestampNow(),
denoms: denomsForWithdraw.map(x => x.denomPub),
withdrawn: denomsForWithdraw.map(x => false),
planchets: denomsForWithdraw.map(x => undefined),
+ totalCoinValue,
};
- const totalCoinValue = Amounts.sum(denomsForWithdraw.map(x => x.value))
- .amount;
const totalCoinWithdrawFee = Amounts.sum(
denomsForWithdraw.map(x => x.feeWithdraw),
).amount;