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.
This commit is contained in:
Olaoluwa Osuntokun committed 2017-12-06 16:43:01 -08:00
1 parent 7960b5240f
commit d6dcc4276c
1 file changed
+9
+9
View File
@@ -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
}