loop: fill the correct HTLC in loopout update

This commit is contained in:
Andras Banki-Horvath 2024-03-21 14:59:24 +01:00
parent c3371fead1
commit 06fd21fd05
No known key found for this signature in database
GPG key ID: 80E5375C094198D8

View file

@ -306,7 +306,11 @@ func (s *loopOutSwap) sendUpdate(ctx context.Context) error {
info := s.swapInfo()
s.log.Infof("Loop out swap state: %v", info.State)
info.HtlcAddressP2WSH = s.htlc.Address
if s.htlc.OutputType == swap.HtlcP2WSH {
info.HtlcAddressP2WSH = s.htlc.Address
} else {
info.HtlcAddressP2TR = s.htlc.Address
}
// In order to avoid potentially dangerous ownership sharing
// we copy the outgoing channel set.