Skip to content

Commit 98bd564

Browse files
authored
Merge pull request #63 from ellemouton/exposOnionKey
sphinx: add OnionPublicKey method to Router
2 parents 6844040 + af42f69 commit 98bd564

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
@@ -613,6 +613,12 @@ func (r *Router) NextEphemeral(ephemPub *btcec.PublicKey) (*btcec.PublicKey,
613613
return NextEphemeral(r.onionKey, ephemPub)
614614
}
615615

616+
// OnionPublicKey returns the public key representing the onion key backing this
617+
// router.
618+
func (r *Router) OnionPublicKey() *btcec.PublicKey {
619+
return r.onionKey.PubKey()
620+
}
621+
616622
// unwrapPacket wraps a layer of the passed onion packet using the specified
617623
// shared secret and associated data. The associated data will be used to check
618624
// the HMAC at each hop to ensure the same data is passed along with the onion

0 commit comments

Comments
 (0)