From d6dcc4276cc73f7c0b8f96f861f2eacab24b0517 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 6 Dec 2017 16:31:52 -0800 Subject: [PATCH] lnwallet: add new IsPending method to the channel state machine The IsPending method will allow callers to determine if a channel has been fully confirmed or not. --- lnwallet/channel.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 3a41944d8..47c980efc 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -5115,3 +5115,12 @@ func (lc *LightningChannel) CommitFeeRate() btcutil.Amount { return lc.channelState.LocalCommitment.FeePerKw } + +// IsPending returns true if the channel's funding transaction has been fully +// confirmed, and false otherwise. +func (lc *LightningChannel) IsPending() bool { + lc.RLock() + defer lc.RUnlock() + + return lc.channelState.IsPending +}