Browse Source
rebase fixup: use new broadcast_transaction API
regtest_lnd
Janus
6 years ago
committed by
SomberNight
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
4 changed files with
12 additions and
8 deletions
-
electrum/gui/qt/channels_list.py
-
electrum/lnbase.py
-
electrum/lnchan.py
-
electrum/lnwatcher.py
|
|
@ -37,9 +37,10 @@ class ChannelsList(MyTreeWidget): |
|
|
|
def close(): |
|
|
|
netw = self.parent.network |
|
|
|
coro = self.parent.wallet.lnworker.close_channel(channel_id) |
|
|
|
suc, msg = netw.run_from_another_thread(coro) |
|
|
|
if not suc: |
|
|
|
self.main_window.show_error('Force-close failed:\n{}'.format(msg)) |
|
|
|
try: |
|
|
|
_txid = netw.run_from_another_thread(coro) |
|
|
|
except Exception as e: |
|
|
|
self.main_window.show_error('Force-close failed:\n{}'.format(repr(e))) |
|
|
|
menu.addAction(_("Force-close channel"), close) |
|
|
|
menu.exec_(self.viewport().mapToGlobal(position)) |
|
|
|
|
|
|
|
|
|
@ -655,8 +655,7 @@ class Peer(PrintError): |
|
|
|
remote_sig = payload['signature'] |
|
|
|
m.receive_new_commitment(remote_sig, []) |
|
|
|
# broadcast funding tx |
|
|
|
success, _txid = await self.network.broadcast_transaction(funding_tx) |
|
|
|
assert success, success |
|
|
|
await self.network.broadcast_transaction(funding_tx) |
|
|
|
m.remote_commitment_to_be_revoked = m.pending_remote_commitment |
|
|
|
m.config[REMOTE] = m.config[REMOTE]._replace(ctn=0) |
|
|
|
m.config[LOCAL] = m.config[LOCAL]._replace(ctn=0, current_commitment_signature=remote_sig) |
|
|
|
|
|
@ -601,7 +601,7 @@ class Channel(PrintError): |
|
|
|
return roundtripped |
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
return self.serialize() |
|
|
|
return str(self.serialize()) |
|
|
|
|
|
|
|
def make_commitment(self, subject, this_point) -> Transaction: |
|
|
|
remote_msat, local_msat = self.amounts() |
|
|
|
|
|
@ -140,8 +140,12 @@ class LNWatcher(PrintError): |
|
|
|
tx_height = self.addr_sync.get_tx_height(ctx_txid).height |
|
|
|
num_conf = local_height - tx_height + 1 |
|
|
|
if num_conf >= e_tx.csv_delay: |
|
|
|
success, msg = await self.network.broadcast_transaction(e_tx.tx) |
|
|
|
self.print_error('broadcast: {}, {}'.format('success' if success else 'failure', msg)) |
|
|
|
try: |
|
|
|
await self.network.broadcast_transaction(e_tx.tx) |
|
|
|
except Exception as e: |
|
|
|
self.print_error('broadcast: {}, {}'.format('failure', repr(e))) |
|
|
|
else: |
|
|
|
self.print_error('broadcast: {}'.format('success')) |
|
|
|
else: |
|
|
|
self.print_error('waiting for CSV ({} < {}) for funding outpoint {} and ctx {}' |
|
|
|
.format(num_conf, e_tx.csv_delay, funding_outpoint, ctx.txid())) |
|
|
|