1
0

auth_protect: pass authMessage in the auth_protect decorator,

instead of relying on side-effects

This is probably safer, and also more self-contained.
This commit is contained in:
ThomasV
2023-04-17 18:17:29 +02:00
parent 73dd6827e0
commit a03f4769ca
7 changed files with 34 additions and 51 deletions

View File

@@ -165,7 +165,6 @@ class QEChannelOpener(QObject, AuthMixin):
node_id=self._node_pubkey,
fee_est=None)
self.auth_message = _('Open Lightning channel?')
acpt = lambda tx: self.do_open_channel(tx, self._connect_str_resolved, self._wallet.password)
self._finalizer = QETxFinalizer(self, make_tx=mktx, accept=acpt)
@@ -174,7 +173,7 @@ class QEChannelOpener(QObject, AuthMixin):
self._finalizer.wallet = self._wallet
self.finalizerChanged.emit()
@auth_protect
@auth_protect(message=_('Open Lichtning channel?'))
def do_open_channel(self, funding_tx, conn_str, password):
"""
conn_str: a connection string that extract_nodeid can parse, i.e. cannot be a trampoline name