mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-20 13:34:32 +01:00
Merge pull request #8968 from ProofOfKeags/opening-party
[MICRO]: channeldb+lnwallet: add OpeningParty API
This commit is contained in:
commit
c262b1b5a5
2 changed files with 20 additions and 0 deletions
|
@ -899,6 +899,18 @@ func (c *OpenChannel) String() string {
|
|||
)
|
||||
}
|
||||
|
||||
// Initiator returns the ChannelParty that originally opened this channel.
|
||||
func (c *OpenChannel) Initiator() lntypes.ChannelParty {
|
||||
c.RLock()
|
||||
defer c.RUnlock()
|
||||
|
||||
if c.IsInitiator {
|
||||
return lntypes.Local
|
||||
}
|
||||
|
||||
return lntypes.Remote
|
||||
}
|
||||
|
||||
// ShortChanID returns the current ShortChannelID of this channel.
|
||||
func (c *OpenChannel) ShortChanID() lnwire.ShortChannelID {
|
||||
c.RLock()
|
||||
|
|
|
@ -8709,6 +8709,14 @@ func (lc *LightningChannel) ChanType() channeldb.ChannelType {
|
|||
return lc.channelState.ChanType
|
||||
}
|
||||
|
||||
// Initiator returns the ChannelParty that originally opened this channel.
|
||||
func (lc *LightningChannel) Initiator() lntypes.ChannelParty {
|
||||
lc.RLock()
|
||||
defer lc.RUnlock()
|
||||
|
||||
return lc.channelState.Initiator()
|
||||
}
|
||||
|
||||
// FundingTxOut returns the funding output of the channel.
|
||||
func (lc *LightningChannel) FundingTxOut() *wire.TxOut {
|
||||
lc.RLock()
|
||||
|
|
Loading…
Add table
Reference in a new issue