From 5b8924b8cfe14909b778ec096b3d893a9dde8533 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 24 Jul 2020 00:22:46 +0530 Subject: logging --- src/operations/reserves.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/operations/reserves.ts') diff --git a/src/operations/reserves.ts b/src/operations/reserves.ts index 51499e448..6045b61d2 100644 --- a/src/operations/reserves.ts +++ b/src/operations/reserves.ts @@ -240,12 +240,18 @@ export async function createReserve( }, ); - ws.notify({ type: NotificationType.ReserveCreated }); + if (reserveRecord.reservePub === resp.reservePub) { + // Only emit notification when a new reserve was created. + ws.notify({ + type: NotificationType.ReserveCreated, + reservePub: reserveRecord.reservePub, + }); + } // Asynchronously process the reserve, but return // to the caller already. processReserve(ws, resp.reservePub, true).catch((e) => { - console.error("Processing reserve (after createReserve) failed:", e); + logger.error("Processing reserve (after createReserve) failed:", e); }); return resp; @@ -318,7 +324,6 @@ async function registerReserveWithBank( return; } const bankStatusUrl = bankInfo.statusUrl; - console.log("making selection"); if (reserve.timestampReserveInfoPosted) { throw Error("bank claims that reserve info selection is not done"); } @@ -788,7 +793,6 @@ export async function createTalerWithdrawReserve( // We do this here, as the reserve should be registered before we return, // so that we can redirect the user to the bank's status page. await processReserveBankStatus(ws, reserve.reservePub); - console.log("acceptWithdrawal: returning"); return { reservePub: reserve.reservePub, confirmTransferUrl: withdrawInfo.confirmTransferUrl, -- cgit v1.2.3