swap: add lasthop, outgoingchanids to swapinfo

This commit is contained in:
sputn1ck 2022-05-27 11:14:16 +02:00
parent e98d813885
commit efb6f75d60
No known key found for this signature in database
GPG key ID: 671103D881A5F0E4
5 changed files with 50 additions and 3 deletions

View file

@ -306,6 +306,15 @@ func (s *loopOutSwap) sendUpdate(ctx context.Context) error {
info.HtlcAddressP2WSH = s.htlc.Address
// In order to avoid potentially dangerous ownership sharing
// we copy the outgoing channel set.
if s.OutgoingChanSet != nil {
outgoingChanSet := make(loopdb.ChannelSet, len(s.OutgoingChanSet))
copy(outgoingChanSet[:], s.OutgoingChanSet[:])
info.OutgoingChanSet = outgoingChanSet
}
select {
case s.statusChan <- *info:
case <-ctx.Done():