From 337234cb0ca68dc5e9a072972928eb56f6e24288 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 4 Aug 2022 14:04:49 +0300 Subject: [PATCH] fix: handle no input signed scenario --- .../components/serial-signer/serial-signer.js | 13 ++++++++++++- .../static/components/wallet-list/wallet-list.html | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js index c6102bef9..b12550319 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -423,10 +423,21 @@ async function serialSigner(path) { }, handleSignResponse: function (res = '') { this.hww.signingPsbt = false - this.updateSignedPsbt(res) + const [count, psbt] = res.trim().split(' ') + if (!psbt || !count || count.trim() === '0') { + this.$q.notify({ + type: 'warning', + message: 'No input signed!', + caption: 'Are you using the right seed?', + timeout: 10000 + }) + return + } + this.updateSignedPsbt(psbt) this.$q.notify({ type: 'positive', message: 'Transaction Signed', + message: `Inputs signed: ${count}`, timeout: 10000 }) }, diff --git a/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.html b/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.html index 3472a52f0..2eda578d3 100644 --- a/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.html +++ b/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.html @@ -191,6 +191,7 @@ label="Account Extended Public Key; xpub, ypub, zpub; Bitcoin Descriptor" >