Skip to content

Commit 9857299

Browse files
committed
fixup! multi: endpoints for onion messages
1 parent 1befe8e commit 9857299

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

onion_message/onion_endpoint.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ package onion_message
22

33
import (
44
"context"
5+
"encoding/hex"
6+
"log/slog"
57

8+
"github.com/lightningnetwork/lnd/lnutils"
69
"github.com/lightningnetwork/lnd/lnwire"
710
"github.com/lightningnetwork/lnd/msgmux"
811
"github.com/lightningnetwork/lnd/subscribe"
@@ -65,9 +68,11 @@ func (o *OnionEndpoint) SendMessage(ctx context.Context,
6568
}
6669

6770
peer := msg.PeerPub.SerializeCompressed()
68-
log.Debugf("OnionEndpoint received OnionMessage from peer %s: "+
69-
"BlindingPoint=%v, OnionPacket[:10]=%x...", peer,
70-
onionMsg.PathKey, onionMsg.OnionBlob)
71+
log.DebugS(ctx, "OnionEndpoint received OnionMessage",
72+
slog.String("peer", hex.EncodeToString(peer)),
73+
lnutils.LogPubKey("path_key", onionMsg.PathKey),
74+
lnutils.LogBytesPreview("onion_blob", onionMsg.OnionBlob),
75+
slog.Int("blob length", len(onionMsg.OnionBlob)))
7176

7277
var peerArr [33]byte
7378
copy(peerArr[:], peer)
@@ -83,7 +88,7 @@ func (o *OnionEndpoint) SendMessage(ctx context.Context,
8388
OnionBlob: onionMsg.OnionBlob,
8489
})
8590
if err != nil {
86-
log.Errorf("Failed to send onion message update: %v", err)
91+
log.ErrorS(ctx, "Failed to send onion message update", err)
8792
return false
8893
}
8994

0 commit comments

Comments
 (0)