cancel_normal_swap unregisters the hold invoice, which can occur before register_hold_invoice in wait_for_htlcs_and_broadcast
if the network call has not returned yet.
Somewhat a follow-up to 649ce979ab.
This adds some safety belts so we don't accidentally sign a tx that
contains a dummy address.
Specifically we check that tx does not contain output for dummy addr:
- in wallet.sign_transaction
- in network.broadcast_transaction
The second one is perhaps redundant, but I think it does not hurt.
lnworker is None if lightning is disabled.
follow-up 649ce979ab
```
15.14 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
File "...\electrum\electrum\gui\qt\rate_limiter.py", line 231, in wrapper
return RateLimiter.invoke(rate, ts_after, func, args, kwargs)
File "...\electrum\electrum\gui\qt\rate_limiter.py", line 79, in invoke
return rl._invoke(args, kwargs)
File "...\electrum\electrum\gui\qt\rate_limiter.py", line 91, in _invoke
return self._doIt()
File "...\electrum\electrum\gui\qt\rate_limiter.py", line 120, in _doIt
retval = self.func(*args, **kwargs) # and.. call the function. use latest invocation's args
File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 745, in _throttled_update
self.update()
File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 750, in update
self.io_widget.update(self.tx)
File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 243, in update
insert_tx_io(
File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 205, in insert_tx_io
tcf_addr = addr_text_format(addr)
File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 173, in addr_text_format
sm = self.wallet.lnworker.swap_manager
AttributeError: 'NoneType' object has no attribute 'swap_manager'
```
Note that HTLCs must not be cancelled after the funding transaction
has been broadcast. If one want to cancel a swap once the funding
transaction is in mempool, one should double spend the transaction.