From 40ca51af0ef7a2477d90b94df3033f2238f430b3 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 4 Aug 2022 13:47:20 +0300 Subject: [PATCH] fix: change & fee value --- .../watchonly/static/components/payment/payment.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lnbits/extensions/watchonly/static/components/payment/payment.js b/lnbits/extensions/watchonly/static/components/payment/payment.js index 6b1f02d37..1459083c1 100644 --- a/lnbits/extensions/watchonly/static/components/payment/payment.js +++ b/lnbits/extensions/watchonly/static/components/payment/payment.js @@ -68,7 +68,7 @@ async function payment(path) { return ( this.selectedAmount - this.totalPayedAmount - - this.feeRate * this.txSizeNoChange + this.feeRate * this.txSize ) }, balance: function () { @@ -184,7 +184,8 @@ async function payment(path) { if (!excludeChange) { const change = this.createChangeOutput() - if (this.changeAmount >= this.DUST_LIMIT) { + const diffAmount = this.selectedAmount - this.totalPayedAmount + if (diffAmount >= this.DUST_LIMIT) { tx.outputs.push(change) } }