aboutsummaryrefslogtreecommitdiff
path: root/lib/wallet/wallet.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/wallet/wallet.ts')
-rw-r--r--lib/wallet/wallet.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/wallet/wallet.ts b/lib/wallet/wallet.ts
index 367c9cbcd..32b85e7b0 100644
--- a/lib/wallet/wallet.ts
+++ b/lib/wallet/wallet.ts
@@ -720,6 +720,10 @@ export class Wallet {
return Query(this.db)
.get("reserves", req.reservePub)
.then((r) => {
+ if (!r) {
+ console.error("Unable to confirm reserve, not found in DB");
+ return;
+ }
r.confirmed = true;
return Query(this.db)
.put("reserves", r)
@@ -770,6 +774,7 @@ export class Wallet {
}
storeCoin(coin: Coin): Promise<void> {
+ console.log("storing coin", new Date());
let historyEntry = {
type: "withdraw",
timestamp: (new Date).getTime(),
@@ -813,6 +818,9 @@ export class Wallet {
let denomsForWithdraw = getWithdrawDenomList(reserve.current_amount,
denomsAvailable);
+ // Number of coins we try to withdraw at once
+ const concurrency = 1;
+
let ps = denomsForWithdraw.map((denom) => {
console.log("withdrawing", JSON.stringify(denom));
// Do the withdraw asynchronously, so crypto is interleaved