lnwallet: add new AbsoluteThawHeight method

This lets callers get the thaw height without needing to first obtain a
snapshot of the channel state.
This commit is contained in:
Olaoluwa Osuntokun 2022-07-26 16:40:58 -07:00
parent c140da8f49
commit 4a997bfdd2
No known key found for this signature in database
GPG Key ID: 3BBD59E99B280306

View File

@ -5659,6 +5659,15 @@ func (lc *LightningChannel) RemoteUpfrontShutdownScript() lnwire.DeliveryAddress
return lc.channelState.RemoteShutdownScript
}
// AbsoluteThawHeight determines a frozen channel's absolute thaw height. If
// the channel is not frozen, then 0 is returned.
//
// An error is returned if the channel is penidng, or is an unconfirmed zero
// conf channel.
func (lc *LightningChannel) AbsoluteThawHeight() (uint32, error) {
return lc.channelState.AbsoluteThawHeight()
}
// getSignedCommitTx function take the latest commitment transaction and
// populate it with witness data.
func (lc *LightningChannel) getSignedCommitTx() (*wire.MsgTx, error) {