lnwatcher: fix parameters to broadcast_transaction

This commit is contained in:
ThomasV 2018-09-26 08:07:48 +02:00
parent d07adda3c0
commit 22b06ddec2

View file

@ -204,7 +204,8 @@ class LNWatcher(PrintError):
tx_height = self.addr_sync.get_tx_height(ctx_txid).height tx_height = self.addr_sync.get_tx_height(ctx_txid).height
num_conf = local_height - tx_height + 1 num_conf = local_height - tx_height + 1
if num_conf >= e_tx.csv_delay: if num_conf >= e_tx.csv_delay:
await self.network.broadcast_transaction(e_tx.tx, self.print_tx_broadcast_result) result = await self.network.broadcast_transaction(e_tx.tx)
self.print_tx_broadcast_result(result)
else: else:
self.print_error('waiting for CSV ({} < {}) for funding outpoint {} and ctx {}' self.print_error('waiting for CSV ({} < {}) for funding outpoint {} and ctx {}'
.format(num_conf, e_tx.csv_delay, funding_outpoint, ctx.txid())) .format(num_conf, e_tx.csv_delay, funding_outpoint, ctx.txid()))
@ -331,12 +332,9 @@ class LNWatcher(PrintError):
return min(map(self.get_tx_mined_status, set_of_txids)) return min(map(self.get_tx_mined_status, set_of_txids))
def print_tx_broadcast_result(self, name, res): def print_tx_broadcast_result(self, res):
error, msg = res success, msg = res
if error: self.print_error('broadcast: {}, {}'.format('success' if success else 'failure', msg))
self.print_error('{} broadcast failed: {}'.format(name, msg))
else:
self.print_error('{} broadcast succeeded'.format(name))