qml: always try to generate an address for request regardless of bolt11_fallback config.
This commit is contained in:
@@ -13,6 +13,8 @@ Pane {
|
||||
|
||||
padding: 0
|
||||
|
||||
property bool _is2fa: Daemon.currentWallet && Daemon.currentWallet.walletType == '2fa'
|
||||
|
||||
function enableLightning() {
|
||||
var dialog = app.messageDialog.createObject(rootItem,
|
||||
{'text': qsTr('Enable Lightning for this wallet?'), 'yesno': true})
|
||||
@@ -168,32 +170,33 @@ Pane {
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
visible: Daemon.currentWallet && Daemon.currentWallet.walletType == '2fa'
|
||||
Layout.preferredWidth: parent.width
|
||||
|
||||
visible: Daemon.currentWallet
|
||||
columns: 2
|
||||
|
||||
Label {
|
||||
visible: _is2fa
|
||||
text: qsTr('2FA')
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
visible: _is2fa
|
||||
text: Daemon.currentWallet.canSignWithoutServer
|
||||
? qsTr('disabled (can sign without server')
|
||||
? qsTr('disabled (can sign without server)')
|
||||
: qsTr('enabled')
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: !Daemon.currentWallet.canSignWithoutServer
|
||||
visible: _is2fa && !Daemon.currentWallet.canSignWithoutServer
|
||||
text: qsTr('Remaining TX')
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
visible: !Daemon.currentWallet.canSignWithoutServer
|
||||
visible: _is2fa && !Daemon.currentWallet.canSignWithoutServer
|
||||
text: 'tx_remaining' in Daemon.currentWallet.billingInfo
|
||||
? Daemon.currentWallet.billingInfo['tx_remaining']
|
||||
: qsTr('unknown')
|
||||
@@ -201,7 +204,7 @@ Pane {
|
||||
|
||||
Label {
|
||||
Layout.columnSpan: 2
|
||||
visible: !Daemon.currentWallet.canSignWithoutServer
|
||||
visible: _is2fa && !Daemon.currentWallet.canSignWithoutServer
|
||||
text: qsTr('Billing')
|
||||
color: Material.accentColor
|
||||
}
|
||||
@@ -209,6 +212,7 @@ Pane {
|
||||
TextHighlightPane {
|
||||
Layout.columnSpan: 2
|
||||
Layout.fillWidth: true
|
||||
visible: _is2fa && !Daemon.currentWallet.canSignWithoutServer
|
||||
|
||||
ColumnLayout {
|
||||
spacing: 0
|
||||
@@ -242,14 +246,6 @@ Pane {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
id: detailsLayout
|
||||
visible: Daemon.currentWallet
|
||||
Layout.preferredWidth: parent.width
|
||||
|
||||
columns: 2
|
||||
Label {
|
||||
text: qsTr('Derivation prefix')
|
||||
visible: Daemon.currentWallet.derivationPrefix
|
||||
|
||||
@@ -607,19 +607,16 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
|
||||
try:
|
||||
default_expiry = self.wallet.config.get('request_expiry', PR_DEFAULT_EXPIRATION_WHEN_CREATING)
|
||||
if self.wallet.lnworker and self.wallet.lnworker.channels:
|
||||
addr = None
|
||||
if self.wallet.config.get('bolt11_fallback', True):
|
||||
addr = self.wallet.get_unused_address()
|
||||
# if addr is None, we ran out of addresses
|
||||
if addr is None:
|
||||
# TODO: remove oldest unpaid request having a fallback address and try again
|
||||
pass
|
||||
addr = self.wallet.get_unused_address()
|
||||
# if addr is None, we ran out of addresses
|
||||
if addr is None:
|
||||
# TODO: remove oldest unpaid request having a fallback address and try again
|
||||
pass
|
||||
key = self.wallet.create_request(None, None, default_expiry, addr)
|
||||
else:
|
||||
key, addr = self.create_bitcoin_request(None, None, default_expiry, ignore_gap)
|
||||
if not key:
|
||||
return
|
||||
# self.addressModel.init_model()
|
||||
except InvoiceError as e:
|
||||
self.requestCreateError.emit('fatal',_('Error creating payment request') + ':\n' + str(e))
|
||||
return
|
||||
|
||||
@@ -122,9 +122,8 @@ class Invoice(StoredObject):
|
||||
address = None
|
||||
if self.outputs:
|
||||
address = self.outputs[0].address if len(self.outputs) > 0 else None
|
||||
if not address:
|
||||
if self.is_lightning():
|
||||
address = self._lnaddr.get_fallback_address() or None
|
||||
if not address and self.is_lightning():
|
||||
address = self._lnaddr.get_fallback_address() or None
|
||||
return address
|
||||
|
||||
def get_outputs(self):
|
||||
|
||||
Reference in New Issue
Block a user