File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -899,6 +899,18 @@ func (c *OpenChannel) String() string {
899899 )
900900}
901901
902+ // Initiator returns the ChannelParty that originally opened this channel.
903+ func (c * OpenChannel ) Initiator () lntypes.ChannelParty {
904+ c .RLock ()
905+ defer c .RUnlock ()
906+
907+ if c .IsInitiator {
908+ return lntypes .Local
909+ }
910+
911+ return lntypes .Remote
912+ }
913+
902914// ShortChanID returns the current ShortChannelID of this channel.
903915func (c * OpenChannel ) ShortChanID () lnwire.ShortChannelID {
904916 c .RLock ()
Original file line number Diff line number Diff line change @@ -8709,6 +8709,14 @@ func (lc *LightningChannel) ChanType() channeldb.ChannelType {
87098709 return lc .channelState .ChanType
87108710}
87118711
8712+ // Initiator returns the ChannelParty that originally opened this channel.
8713+ func (lc * LightningChannel ) Initiator () lntypes.ChannelParty {
8714+ lc .RLock ()
8715+ defer lc .RUnlock ()
8716+
8717+ return lc .channelState .Initiator ()
8718+ }
8719+
87128720// FundingTxOut returns the funding output of the channel.
87138721func (lc * LightningChannel ) FundingTxOut () * wire.TxOut {
87148722 lc .RLock ()
You can’t perform that action at this time.
0 commit comments