do not block GUI with open_channel
This commit is contained in:
@@ -582,7 +582,6 @@ class Peer(PrintError):
|
||||
self.privkey = lnworker.privkey
|
||||
self.network = lnworker.network
|
||||
self.channel_db = lnworker.channel_db
|
||||
self.path_finder = lnworker.path_finder
|
||||
self.channel_state = lnworker.channel_state
|
||||
self.read_buffer = b''
|
||||
self.ping_time = 0
|
||||
|
||||
@@ -180,8 +180,7 @@ class LNWorker(PrintError):
|
||||
|
||||
def open_channel(self, node_id, local_amt_sat, push_amt_sat, pw):
|
||||
coro = self._open_channel_coroutine(node_id, local_amt_sat, push_amt_sat, None if pw == "" else pw)
|
||||
# FIXME this is blocking the GUI
|
||||
return asyncio.run_coroutine_threadsafe(coro, self.network.asyncio_loop).result()
|
||||
return asyncio.run_coroutine_threadsafe(coro, self.network.asyncio_loop)
|
||||
|
||||
def pay(self, invoice):
|
||||
addr = lndecode(invoice, expected_hrp=constants.net.SEGWIT_HRP)
|
||||
|
||||
@@ -5,8 +5,8 @@ import unittest
|
||||
from lib.util import bh2u, bfh
|
||||
from lib.lnbase import make_commitment, get_obscured_ctn, Peer, make_offered_htlc, make_received_htlc, make_htlc_tx
|
||||
from lib.lnbase import secret_to_pubkey, derive_pubkey, derive_privkey, derive_blinded_pubkey, overall_weight
|
||||
from lib.lnbase import make_htlc_tx_output, make_htlc_tx_inputs, get_per_commitment_secret_from_seed
|
||||
from lib.lnbase import make_htlc_tx_witness, OnionHopsDataSingle, new_onion_packet, OnionPerHop
|
||||
from lib.lnbase import make_htlc_tx_output, make_htlc_tx_inputs, get_per_commitment_secret_from_seed, make_htlc_tx_witness
|
||||
from lib.lnrouter import OnionHopsDataSingle, new_onion_packet, OnionPerHop
|
||||
from lib.lnbase import RevocationStore
|
||||
from lib.transaction import Transaction
|
||||
from lib import bitcoin
|
||||
|
||||
Reference in New Issue
Block a user