From 83362bd4e3645e7ad1b8e33549a8d70a46a12ae1 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 27 Nov 2020 08:52:46 -0800 Subject: [PATCH] fix repayment, dont include failed payments in tx list --- dist/src/controllers/payment.js | 6 ++++-- dist/src/controllers/payment.js.map | 2 +- dist/src/utils/timers.js | 1 + dist/src/utils/timers.js.map | 2 +- src/controllers/payment.ts | 6 ++++-- src/utils/timers.ts | 1 + 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dist/src/controllers/payment.js b/dist/src/controllers/payment.js index 0578089..5d07379 100644 --- a/dist/src/controllers/payment.js +++ b/dist/src/controllers/payment.js @@ -165,7 +165,8 @@ exports.listPayments = (req, res) => __awaiter(void 0, void 0, void 0, function* constants_1.default.message_types.direct_payment, constants_1.default.message_types.keysend, constants_1.default.message_types.purchase, - ] } + ] }, + status: { [sequelize_1.Op.not]: constants_1.default.statuses.failed } }, { type: { [sequelize_1.Op.or]: [ @@ -175,7 +176,8 @@ exports.listPayments = (req, res) => __awaiter(void 0, void 0, void 0, function* amount: { [sequelize_1.Op.gt]: MIN_VAL // greater than }, - network_type: constants_1.default.network_types.lightning + network_type: constants_1.default.network_types.lightning, + status: { [sequelize_1.Op.not]: constants_1.default.statuses.failed } } ], }, diff --git a/dist/src/controllers/payment.js.map b/dist/src/controllers/payment.js.map index 009a8bc..4385531 100644 --- a/dist/src/controllers/payment.js.map +++ b/dist/src/controllers/payment.js.map @@ -1 +1 @@ -{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/controllers/payment.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,wCAA4C;AAC5C,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AACpC,yCAA8B;AAC9B,iCAAuC;AAE1B,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAA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;wBACD,YAAY,EAAE,mBAAS,CAAC,aAAa,CAAC,SAAS;qBAChD;iBACF;aACF;YACD,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAC9B,KAAK;YACL,MAAM;SACP,CAAC,CAAA;QACF,MAAM,GAAG,GAAG,IAAI,IAAE,EAAE,CAAA;QACpB,aAAO,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAA,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;KACxE;IAAC,OAAM,CAAC,EAAE;QACT,aAAO,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAA;KACnC;AACH,CAAC,CAAA,CAAC"} \ No newline at end of file +{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/controllers/payment.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,wCAA4C;AAC5C,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AACpC,yCAA8B;AAC9B,iCAAuC;AAE1B,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC5C,MAAM,EACJ,MAAM,EACN,OAAO,EACP,UAAU,EACV,eAAe,EACf,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,UAAU,GACX,GAAG,GAAG,CAAC,IAAI,CAAA;IAEZ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IAEvC,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;IAEvE,IAAI,eAAe,IAAI,CAAC,UAAU,IAAI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,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAA,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;KACxE;IAAC,OAAM,CAAC,EAAE;QACT,aAAO,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAA;KACnC;AACH,CAAC,CAAA,CAAC"} \ No newline at end of file diff --git a/dist/src/utils/timers.js b/dist/src/utils/timers.js index e27a869..cc33c71 100644 --- a/dist/src/utils/timers.js +++ b/dist/src/utils/timers.js @@ -100,6 +100,7 @@ function payBack(t) { message: { id: t.msgId, amount: t.amount }, amount: t.amount, type: constants_1.default.message_types.repayment, + realSatsContactId: t.receiver }); models_1.models.Timer.destroy({ where: { id: t.id } }); }); diff --git a/dist/src/utils/timers.js.map b/dist/src/utils/timers.js.map index 2e67873..78f6b9b 100644 --- a/dist/src/utils/timers.js.map +++ b/dist/src/utils/timers.js.map @@ -1 +1 @@ -{"version":3,"file":"timers.js","sourceRoot":"","sources":["../../../src/utils/timers.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,sCAAqC;AACrC,4CAAoC;AAEpC,MAAM,MAAM,GAAC,EAAE,CAAA;AACf,SAAS,UAAU,CAAC,CAAC;IACjB,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;IACxB,IAAG,IAAI;QAAE,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;AACvC,CAAC;AACD,SAAsB,kBAAkB,CAAC,KAAK;;QAC1C,MAAM,CAAC,GAAG,MAAM,eAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC,EAAC,KAAK,EAAC,EAAC,CAAC,CAAA;QACrD,UAAU,CAAC,CAAC,CAAC,CAAA;QACb,eAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC,EAAC,KAAK,EAAC,EAAC,CAAC,CAAA;IACzC,CAAC;CAA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,EAAE,CAAC,CAAC,QAAQ;SAChC,CAAC,CAAA;QACF,eAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC,EAAC,EAAE,EAAC,CAAC,CAAC,EAAE,EAAC,EAAC,CAAC,CAAA;IAC3C,CAAC;CAAA;AAjBD,0BAiBC"} \ No newline at end of file diff --git a/src/controllers/payment.ts b/src/controllers/payment.ts index 6e3370a..338f6b1 100644 --- a/src/controllers/payment.ts +++ b/src/controllers/payment.ts @@ -181,7 +181,8 @@ export const listPayments = async (req, res) => { constants.message_types.direct_payment, constants.message_types.keysend, constants.message_types.purchase, - ]} + ]}, + status: {[Op.not]: constants.statuses.failed} }, { type: {[Op.or]: [ @@ -191,7 +192,8 @@ export const listPayments = async (req, res) => { amount: { [Op.gt]: MIN_VAL // greater than }, - network_type: constants.network_types.lightning + network_type: constants.network_types.lightning, + status: {[Op.not]: constants.statuses.failed} } ], }, diff --git a/src/utils/timers.ts b/src/utils/timers.ts index 4f8ad75..bbc733c 100644 --- a/src/utils/timers.ts +++ b/src/utils/timers.ts @@ -72,6 +72,7 @@ export async function payBack(t){ message: {id:t.msgId,amount:t.amount}, amount: t.amount, type: constants.message_types.repayment, + realSatsContactId: t.receiver }) models.Timer.destroy({where:{id:t.id}}) }