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

@ -431,6 +431,14 @@ func (s *loopInSwap) sendUpdate(ctx context.Context) error {
info.HtlcAddressNP2WSH = s.htlcNP2WSH.Address
info.ExternalHtlc = s.ExternalHtlc
// In order to avoid potentially dangerous ownership sharing
// we copy the last hop vertex.
if s.LastHop != nil {
lastHop := &route.Vertex{}
copy(lastHop[:], s.LastHop[:])
info.LastHop = lastHop
}
select {
case s.statusChan <- *info:
case <-ctx.Done():