Skip to content

Commit 0990a2b

Browse files
committed
sphinx: add OnionPublicKey method to Router
Expose the public key of the key that they router is backed by.
1 parent 06182b1 commit 0990a2b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sphinx.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,12 @@ func (r *Router) NextEphemeral(ephemPub *btcec.PublicKey) (*btcec.PublicKey,
627627
return NextEphemeral(r.onionKey, ephemPub)
628628
}
629629

630+
// OnionPublicKey returns the public key representing the onion key backing this
631+
// router.
632+
func (r *Router) OnionPublicKey() *btcec.PublicKey {
633+
return r.onionKey.PubKey()
634+
}
635+
630636
// unwrapPacket wraps a layer of the passed onion packet using the specified
631637
// shared secret and associated data. The associated data will be used to check
632638
// the HMAC at each hop to ensure the same data is passed along with the onion

0 commit comments

Comments
 (0)