From 4790ce96a86bf9c408242d4de678fe6b82f24bc9 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 22 Dec 2016 13:27:28 -0800 Subject: [PATCH] lnwallet: public expose funding keys in channel state machine This commit modifies the attributes of the LightningChannel struct to publicly expose the funding keys used within the channel for the local and remote party. Exposing these keys publicly will allow callers to use the keys involved to generate authenticated channel advertisements for the routing layer. --- lnwallet/channel.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 15750c61..46e69cbf 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -432,6 +432,15 @@ type LightningChannel struct { // counter party has broadcast a prior *revoked* state. ContractBreach chan *BreachRetribution + // LocalFundingKey is the public key under control by the wallet that + // was used for the 2-of-2 funding output which created this channel. + LocalFundingKey *btcec.PublicKey + + // RemoteFundingKey is the public key for the remote channel counter + // party which used for the 2-of-2 funding output which created this + // channel. + RemoteFundingKey *btcec.PublicKey + started int32 shutdown int32 @@ -468,6 +477,8 @@ func NewLightningChannel(signer Signer, bio BlockChainIO, ForceCloseSignal: make(chan struct{}), UnilateralCloseSignal: make(chan struct{}), ContractBreach: make(chan *BreachRetribution, 1), + LocalFundingKey: state.OurMultiSigKey, + RemoteFundingKey: state.TheirMultiSigKey, } // Initialize both of our chains the current un-revoked commitment for