|
|
@ -15,6 +15,7 @@ from electrum.lnutil import ln_dummy_address, extract_nodeid |
|
|
|
from .label_dialog import LabelDialog |
|
|
|
from .confirm_tx_dialog import ConfirmTxDialog |
|
|
|
from .qr_dialog import QRDialog |
|
|
|
from .question import Question |
|
|
|
|
|
|
|
if TYPE_CHECKING: |
|
|
|
from ...main_window import ElectrumWindow |
|
|
@ -179,6 +180,18 @@ class LightningOpenChannelDialog(Factory.Popup, Logger): |
|
|
|
amount = '!' if self.is_max else self.app.get_amount(self.amount) |
|
|
|
self.dismiss() |
|
|
|
lnworker = self.app.wallet.lnworker |
|
|
|
node_id, rest = extract_nodeid(conn_str) |
|
|
|
if lnworker.has_conflicting_backup_with(node_id): |
|
|
|
msg = messages.MGS_CONFLICTING_BACKUP_INSTANCE |
|
|
|
d = Question(msg, lambda x: self._open_channel(x, conn_str, amount)) |
|
|
|
d.open() |
|
|
|
else: |
|
|
|
self._open_channel(True, conn_str, amount) |
|
|
|
|
|
|
|
def _open_channel(self, x, conn_str, amount): |
|
|
|
if not x: |
|
|
|
return |
|
|
|
lnworker = self.app.wallet.lnworker |
|
|
|
coins = self.app.wallet.get_spendable_coins(None, nonlocal_only=True) |
|
|
|
node_id, rest = extract_nodeid(conn_str) |
|
|
|
make_tx = lambda rbf: lnworker.mktx_for_open_channel( |
|
|
|