Janus
6 years ago
committed by
SomberNight
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
2 changed files with
10 additions and
1 deletions
-
electrum/commands.py
-
electrum/lnbase.py
|
|
@ -812,6 +812,14 @@ class Commands: |
|
|
|
def listinvoices(self): |
|
|
|
return "\n".join(self.wallet.lnworker.list_invoices()) |
|
|
|
|
|
|
|
@command('wn') |
|
|
|
def closechannel(self, channel_point, force=False): |
|
|
|
chan_id = bytes(reversed(bfh(channel_point))) |
|
|
|
if force: |
|
|
|
return self.network.run_from_another_thread(self.wallet.lnworker.force_close_channel(chan_id)) |
|
|
|
else: |
|
|
|
return self.network.run_from_another_thread(self.wallet.lnworker.close_channel(chan_id)) |
|
|
|
|
|
|
|
def eval_bool(x: str) -> bool: |
|
|
|
if x == 'false': return False |
|
|
|
if x == 'true': return True |
|
|
|
|
|
@ -1180,7 +1180,8 @@ class Peer(PrintError): |
|
|
|
async def _shutdown(self, chan: Channel, payload): |
|
|
|
# set state so that we stop accepting HTLCs |
|
|
|
chan.set_state('CLOSING') |
|
|
|
while len(chan.htlcs(LOCAL, only_pending=True)) > 0: |
|
|
|
while len(chan.hm.htlcs_by_direction(LOCAL, RECEIVED)) > 0: |
|
|
|
self.print_error('waiting for htlcs to settle...') |
|
|
|
await asyncio.sleep(1) |
|
|
|
our_fee = chan.pending_local_fee() |
|
|
|
scriptpubkey = bfh(bitcoin.address_to_script(chan.sweep_address)) |
|
|
|