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 2017-12-06 16:31:52 -08:00
parent 7960b5240f
commit d6dcc4276c
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

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
}